fix some bugs, add new path rule_beta.json

This commit is contained in:
EstrellaXD
2022-06-04 10:39:38 +08:00
parent 20fc2846f5
commit 5c435ccd1f
6 changed files with 87 additions and 28 deletions

View File

@@ -32,14 +32,16 @@ def save_data_file(bangumi_data):
def run():
args = parse()
if args.debug:
try:
from const_dev import DEV_SETTINGS
except ModuleNotFoundError:
logger.debug("Please copy `const_dev.sample.py` to `const_dev.py` to use custom settings")
settings.init(DEV_SETTINGS)
else:
settings.init()
from const_dev import DEV_SETTINGS
settings.init(DEV_SETTINGS)
# if args.debug:
# try:
# from const_dev import DEV_SETTINGS
# except ModuleNotFoundError:
# logger.debug("Please copy `const_dev.py` to `const_dev.py` to use custom settings")
# settings.init(DEV_SETTINGS)
# else:
# settings.init()
setup_logger()
bangumi_data = load_data_file()
download_client = DownloadClient()
@@ -49,7 +51,7 @@ def run():
while True:
try:
rss_collector.collect(bangumi_data)
if settings.ep_complete:
if settings.enable_eps_complete:
download_client.add_rules(bangumi_data["bangumi_info"])
download_client.eps_collect(bangumi_data["bangumi_info"])
renamer.run()
@@ -62,4 +64,4 @@ def run():
if __name__ == "__main__":
run()
run()

View File

@@ -18,7 +18,7 @@ class ParserLV2:
if re.search(group, name) is not None:
self.type = i["type"]
return group
logger.warning(f"no Group match {name}")
logger.warning(f"No Group matched with {name}.")
def pre_process(self, raw_name):
if re.search(r"新番|月?番", raw_name):
@@ -121,11 +121,12 @@ if __name__ == "__main__":
for name in f:
if name != "":
try:
print(name)
title, season, episode = parser.analyse(name)
print(title)
print(season)
print(episode)
parser.get_group(name)
# title, season, episode = parser.analyse(name)
# print(name)
# print(title)
# print(season)
# print(episode)
except:
if (
re.search(

View File

@@ -10,7 +10,7 @@ DEFAULT_SETTINGS = {
"method": "pn",
"enable_group_tag": True,
"info_path": "/config/bangumi.json",
"rule_path": "/config/rule.json",
"rule_path": "/config/rule_beta.json",
"not_contain": "720",
"get_rule_debug": False,
"rule_url": "https://raw.githubusercontent.com/EstrellaXD/Bangumi_Auto_Collector/main/AutoBangumi/config/rule.json",

View File

@@ -1,10 +0,0 @@
DEV_SETTINGS = {
"host_ip": "localhost:8080",
"user_name": "admin",
"password": "adminadmin",
"rss_link": "https://mikanani.me/RSS/classic",
"sleep_time": 10,
"info_path": "../config/bangumi.json",
"rule_path": "../config/rule.json",
"enable_eps_complete": True,
}

View File

@@ -70,7 +70,7 @@ class DownloadClient:
def eps_collect(self, bangumi_info):
logger.debug("Start collect past eps.")
for info in bangumi_info:
if "download_past" not in info:
if not info["download_past"]:
FullSeasonGet(info["group"], info["title"], info["season"]).run()

66
config/rule_beta.json Normal file
View File

@@ -0,0 +1,66 @@
[
{
"group_name": [
"Lilith-Raws",
"NC-Raws",
"Skymoon-Raws",
"天月搬运组",
"LoliHouse",
"猎户不鸽发布组",
"NaN-Raws",
"猎户随缘发布组",
"桜都字幕组",
"澄空学园&雪飘工作室",
"千夏字幕组",
"IET字幕组",
"离谱Sub",
"酷漫404",
"星空字幕组",
"轻之国度字幕组",
"枫叶字幕组",
"雪飘工作室",
"豌豆字幕组",
"云光字幕组",
"悠哈璃羽字幕社",
"桜都字幕组",
"ANi",
"❀拨雪寻春❀",
"极彩字幕组",
"悠哈璃羽字幕社",
"爱恋&漫猫字幕组",
"MingY",
"VCB-Studio",
"虹咲学园烤肉同好会",
"喵萌奶茶屋",
"爱恋字母社",
"诸神字幕组",
"驯兽师联盟",
"夏沐字幕组",
"幻樱",
"动漫国字幕组",
"SweetSub&圆环记录攻略组",
"动漫萌",
"极影字幕社",
"喵萌Production",
"Lolihouse",
"PCSUB",
"桜都字幕組",
"LowPower-Raws",
"雪飄工作室"
],
"type": 1
},
{
"group_name": [
"爱恋字母社",
"風車字幕組",
"幻櫻字幕組",
"幻櫻字幕組",
"Dymy字幕組",
"動漫國字幕組",
"c.c動漫",
"动漫国字幕组"
],
"type": 2
}
]