This commit is contained in:
EstrellaXD
2022-06-04 18:23:02 +08:00
parent 09db87265d
commit 29dbaa6442
6 changed files with 11 additions and 13 deletions

View File

@@ -43,12 +43,12 @@ def run():
else:
settings.init()
setup_logger()
bangumi_data = load_data_file()
download_client = DownloadClient()
download_client.rss_feed()
rss_collector = RSSCollector()
renamer = Renamer(download_client)
while True:
bangumi_data = load_data_file()
try:
rss_collector.collect(bangumi_data)
if settings.enable_eps_complete:

View File

@@ -43,7 +43,10 @@ class ParserLV2:
if not seasons:
name = name_season
season_number = 1
season_raw = ""
if settings.season_one_tag:
season_raw = "S01"
else:
season_raw = ""
else:
name = re.sub(season_rule, "", name_season)
for season in seasons:

View File

@@ -16,7 +16,8 @@ DEFAULT_SETTINGS = {
"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": True,
"season_one_tag": True
}
ENV_TO_ATTR = {
@@ -33,8 +34,9 @@ ENV_TO_ATTR = {
"AB_DEBUG_MODE": ("debug_mode", lambda e: e.lower() in ("true", "1", "t")),
"AB_EP_COMPLETE": (
"enable_eps_complete",
lambda e: e.lower() in ("true", "1", "t"),
lambda e: e.lower() in ("true", "1", "t")
),
"AB_SEASON_ONE": ("season_one_tag", lambda e: e.lower() in ("true", "1", "t"))
}
FULL_SEASON_SUPPORT_GROUP = ["Lilith-Raws"]

View File

@@ -73,8 +73,6 @@ class DownloadClient:
if info["download_past"]:
FullSeasonGet(info["group"], info["title"], info["season"]).run()
info["download_past"] = False
json_config.save(settings.info_path, bangumi_info,)
def get_torrent_info(self):
return self.client.torrents_info(

View File

@@ -47,4 +47,4 @@ class RSSCollector:
"download_past": download_past
}
)
logger.info(f"add {title} Season {season.raw}")
logger.info(f"add {title} Season {season.number}")

View File

@@ -1,16 +1,11 @@
import logging
from conf import settings
if settings.debug_mode:
debug_level = logging.DEBUG
else:
debug_level = logging.INFO
def setup_logger():
DATE_FORMAT = "%Y-%m-%d %X"
LOGGING_FORMAT = "%(asctime)s %(levelname)s: %(message)s"
logging.basicConfig(
level=debug_level,
level=logging.INFO,
datefmt=DATE_FORMAT,
format=LOGGING_FORMAT,
encoding="utf-8",