2.5.5 修复首次启动可能无法添加RSS的错误

This commit is contained in:
EstrellaXD
2022-07-05 00:25:19 +08:00
parent 33b7cb6da7
commit 52efd45429
5 changed files with 23 additions and 26 deletions

View File

@@ -87,6 +87,17 @@ async def search(input: Search):
return "Nothing Happened"
class AddRule(BaseModel):
title: str
season: int
@app.post("/api/v1/addrule")
async def add_rule(info: AddRule):
return "success"
def run():
args = parse()
if args.debug:

View File

@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
DEFAULT_SETTINGS = {
"version": "2.5.1",
"version": "2.5.5",
"data_version": 4.0,
"host_ip": "localhost:8080",
"sleep_time": 7200,

View File

@@ -83,5 +83,5 @@ if __name__ == "__main__":
settings.init(DEV_SETTINGS)
client = DownloadClient()
rename = Renamer(client)
print(rename.split_path("/downloads/Bangumi/勇者辞职.mp4"))
rename.run()
# rename.set_folder()

View File

@@ -22,15 +22,17 @@ class RSSAnalyser:
for raw_title in rss_titles:
logger.debug(raw_title)
extra_add = True
for d in bangumi_info:
if re.search(d["title_raw"], raw_title) is not None:
logger.debug(f"Had added {d['title_raw']} before")
extra_add = False
break
if bangumi_info is not []:
for d in bangumi_info:
if re.search(d["title_raw"], raw_title) is not None:
logger.debug(f"Had added {d['title_raw']} before")
extra_add = False
break
if extra_add:
data = self._title_analyser.return_dict(raw_title)
if data["official_title"] not in bangumi_info:
if data is not None and data["official_title"] not in bangumi_info:
bangumi_info.append(data)
return bangumi_info
def rss_to_data(self, url):
rss_title = self._request.get_title(url)
@@ -55,23 +57,7 @@ if __name__ == "__main__":
print(settings.host_ip)
client = DownloadClient()
ra = RSSAnalyser()
data = [{'official_title': '勇者辞职不干了', 'title_raw': 'Yuusha, Yamemasu', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': False, 'eps_collect': False},
{'official_title': '朋友游戏', 'title_raw': 'Tomodachi Game', 'season': 1, 'season_raw': '', 'group': '离谱Sub', 'dpi': '1080p', 'source': None, 'subtitle': '简体内嵌', 'added': True, 'eps_collect': False},
{'official_title': '街角魔族', 'title_raw': 'Machikado Mazoku: 2-choume', 'season': 2, 'season_raw': '', 'group': '桜都字幕组', 'dpi': '1080P', 'source': None, 'subtitle': '简繁内封', 'added': True, 'eps_collect': False},
{'official_title': '杜鹃的婚约', 'title_raw': 'Kakkou no Iinazuke', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '间谍过家家', 'title_raw': 'SPYxFAMILY', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': 'Love Live虹咲学园 学园偶像同好会', 'title_raw': 'Love Live虹咲学园 学园偶像同好会', 'season': 2, 'season_raw': 'S02', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '指名!', 'title_raw': 'CUE!', 'season': 1, 'season_raw': '', 'group': '喵萌Production', 'dpi': '1080p', 'source': None, 'subtitle': '简日双语', 'added': True, 'eps_collect': False},
{'official_title': '辉夜大小姐想让我告白', 'title_raw': 'Kaguya-sama wa Kokurasetai', 'season': None, 'season_raw': 'S03', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '处刑少女的生存之道', 'title_raw': 'Shokei Shoujo no Virgin Road', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': 'Kakkou no Iikagen', 'title_raw': 'Kakkou no Iikagen', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '古见同学有交流障碍症。', 'title_raw': 'Komi-san wa, Komyushou Desu.', 'season': 2, 'season_raw': '', 'group': '幻樱字幕组', 'dpi': '1920X1080', 'source': None, 'subtitle': 'GB', 'added': True, 'eps_collect': False},
{'official_title': '夏日重现', 'title_raw': 'Summer Time Rendering', 'season': 1, 'season_raw': '', 'group': '喵萌奶茶屋', 'dpi': '1080p', 'source': None, 'subtitle': '简日双语', 'added': True, 'eps_collect': False},
{'official_title': '魔法使黎明期', 'title_raw': 'Mahoutsukai Reimeiki', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '派对浪客诸葛孔明', 'title_raw': 'Paripi Koumei', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': None, 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '相合之物', 'title_raw': 'Deaimon', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '盾之勇者成名录', 'title_raw': 'Tate no Yuusha no Nariagari', 'season': 2, 'season_raw': 'S02', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False},
{'official_title': '史上最强大魔王转生为村民A', 'title_raw': 'Shijou Saikyou no Daimaou', 'season': 1, 'season_raw': '', 'group': 'Lilith-Raws', 'dpi': '1080p', 'source': 'Baha', 'subtitle': 'CHT', 'added': True, 'eps_collect': False}]
data = []
ra.run(data, client)
for d in data:
print(d)

View File

@@ -65,7 +65,7 @@ class QbDownloader:
try:
self._client.rss_remove_item(item_path)
except Conflict409Error as e:
logger.exception(e)
# logger.exception(e)
logger.info("Add new RSS")
raise ConflictError()