From 0fc00c4c1c9b02965cfa531cfc7fc0d9802127b6 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Thu, 11 May 2023 13:59:06 +0800 Subject: [PATCH] Fix poster link problem --- src/module/database/bangumi.py | 3 ++- src/module/parser/analyser/tmdb_parser.py | 4 ++-- src/module/parser/analyser/torrent_parser.py | 5 ----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/module/database/bangumi.py b/src/module/database/bangumi.py index 87e8b9ec..c52f1a73 100644 --- a/src/module/database/bangumi.py +++ b/src/module/database/bangumi.py @@ -180,7 +180,8 @@ class BangumiDatabase(DataConnector): return "" for official_title, poster_link in data: if official_title in bangumi_name: - return poster_link + if poster_link: + return poster_link return "" def match_list(self, title_dict: dict, rss_link: str) -> dict: diff --git a/src/module/parser/analyser/tmdb_parser.py b/src/module/parser/analyser/tmdb_parser.py index 2c91f8f2..65f8f8eb 100644 --- a/src/module/parser/analyser/tmdb_parser.py +++ b/src/module/parser/analyser/tmdb_parser.py @@ -63,7 +63,7 @@ def tmdb_parser(title, language) -> TMDBInfo | None: break url_info = info_url(id, language) info_content = req.get_json(url_info) - season = [{"season": s.get("name"), "air_date": s.get("air_date")} for s in info_content.get("seasons")] + season = [{"season": s.get("name"), "air_date": s.get("air_date"), "poster_path": s.get("poster_path")} for s in info_content.get("seasons")] last_season = get_season(season) original_title = info_content.get("original_name") official_title = info_content.get("name") @@ -74,5 +74,5 @@ def tmdb_parser(title, language) -> TMDBInfo | None: if __name__ == '__main__': - title = "鬼灭之刃+刀匠村篇" + title = "鬼灭之刃" print(tmdb_parser(title, "zh")) \ No newline at end of file diff --git a/src/module/parser/analyser/torrent_parser.py b/src/module/parser/analyser/torrent_parser.py index bc65dbbc..83900ae9 100644 --- a/src/module/parser/analyser/torrent_parser.py +++ b/src/module/parser/analyser/torrent_parser.py @@ -99,8 +99,3 @@ def torrent_parser( suffix=suffix ) - -if __name__ == '__main__': - name = "海盗战记 (2019) S01E01.mp4" - bf = torrent_parser(name, file_type="media") - print(bf) \ No newline at end of file