mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-23 18:11:37 +08:00
修复bug
This commit is contained in:
@@ -51,7 +51,7 @@ def run():
|
||||
# init_switch()
|
||||
settings.init()
|
||||
setup_logger()
|
||||
time.sleep(10)
|
||||
time.sleep(3)
|
||||
download_client = DownloadClient()
|
||||
download_client.init_downloader()
|
||||
download_client.rss_feed()
|
||||
|
||||
@@ -9,15 +9,14 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class ParserLV2:
|
||||
def __init__(self) -> None:
|
||||
self.info = json_config.load(settings.rule_path)
|
||||
self._info = Episode()
|
||||
|
||||
def pre_process(self, raw_name):
|
||||
pro_name = raw_name.replace("【", "[").replace("】", "]")
|
||||
return pro_name
|
||||
|
||||
def get_group(self, name):
|
||||
group = re.split(r"[\[\]]", name)[1]
|
||||
return group
|
||||
self._info.group = re.split(r"[\[\]]", name)[1]
|
||||
|
||||
def second_process(self, raw_name):
|
||||
if re.search(r"新番|月?番", raw_name):
|
||||
@@ -115,16 +114,15 @@ class ParserLV2:
|
||||
episode = int(re.findall(r"\d{1,3}", match_obj.group(2))[0])
|
||||
other = match_obj.group(3).strip()
|
||||
sub, dpi, source= self.find_tags(other)
|
||||
return group, name, season_number, season_raw, episode, sub, dpi, source
|
||||
return name, season_number, season_raw, episode, sub, dpi, source
|
||||
|
||||
def analyse(self, raw) -> Episode:
|
||||
try:
|
||||
info = Episode()
|
||||
info.group, info.title, info.season_info.number,\
|
||||
info.season_info.raw, info.ep_info.number,\
|
||||
info.subtitle, info.dpi, info.source \
|
||||
self._info.title, self._info.season_info.number,\
|
||||
self._info.season_info.raw, self._info.ep_info.number,\
|
||||
self._info.subtitle, self._info.dpi, self._info.source \
|
||||
= self.process(raw)
|
||||
return info
|
||||
return self._info
|
||||
except:
|
||||
logger.warning(f"ERROR match {raw}")
|
||||
|
||||
|
||||
@@ -11,13 +11,13 @@ DEFAULT_SETTINGS = {
|
||||
"enable_group_tag": True,
|
||||
"info_path": "/config/bangumi.json",
|
||||
"not_contain": "720",
|
||||
"get_rule_debug": False,
|
||||
"rule_url": "https://raw.githubusercontent.com/EstrellaXD/Bangumi_Auto_Collector/main/AutoBangumi/config/rule.json",
|
||||
"rule_name_re": r"\:|\/|\.",
|
||||
"connect_retry_interval": 5,
|
||||
"debug_mode": True,
|
||||
"debug_mode": False,
|
||||
"season_one_tag": True,
|
||||
"remove_bad_torrent": False,
|
||||
"add_pause": False,
|
||||
"data_version": 3.0
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ ENV_TO_ATTR = {
|
||||
"AB_METHOD": "method",
|
||||
"AB_GROUP_TAG": ("enable_group_tag", lambda e: e.lower() in ("true", "1", "t")),
|
||||
"AB_NOT_CONTAIN": "not_contain",
|
||||
"AB_RULE_DEBUG": ("get_rule_debug", lambda e: e.lower() in ("true", "1", "t")),
|
||||
"AB_DEBUG_MODE": ("debug_mode", lambda e: e.lower() in ("true", "1", "t")),
|
||||
"AB_EP_COMPLETE": (
|
||||
"enable_eps_complete",
|
||||
|
||||
12
auto_bangumi/core/fuzz_match.py
Normal file
12
auto_bangumi/core/fuzz_match.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from thefuzz import fuzz
|
||||
|
||||
|
||||
# TODO 模糊匹配模块
|
||||
|
||||
|
||||
class FuzzMatch:
|
||||
def __init__(self, anidb_data):
|
||||
self.match_data = anidb_data
|
||||
|
||||
def fuzz(self, raw_name):
|
||||
fuzz.radio()
|
||||
@@ -36,7 +36,7 @@ class QbDownloader:
|
||||
|
||||
def torrents_add(self, urls, save_path, category):
|
||||
return self._client.torrents_add(
|
||||
is_paused=False,
|
||||
is_paused=settings.add_pause,
|
||||
urls=urls,
|
||||
save_path=save_path,
|
||||
category=category,
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import logging
|
||||
from conf import settings
|
||||
|
||||
|
||||
def setup_logger():
|
||||
if settings.debug_mode:
|
||||
level = logging.DEBUG
|
||||
else:
|
||||
level = logging.INFO
|
||||
DATE_FORMAT = "%Y-%m-%d %X"
|
||||
LOGGING_FORMAT = "%(asctime)s %(levelname)s: %(message)s"
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
level=level,
|
||||
datefmt=DATE_FORMAT,
|
||||
format=LOGGING_FORMAT,
|
||||
encoding="utf-8",
|
||||
|
||||
Reference in New Issue
Block a user