mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-04-28 12:30:20 +08:00
Fix: test.
This commit is contained in:
@@ -56,7 +56,7 @@ def get_season(seasons: list) -> tuple[int, str]:
|
||||
return len(ss), ss[-1].get("poster_path")
|
||||
|
||||
|
||||
def tmdb_parser(title, language) -> TMDBInfo | None:
|
||||
def tmdb_parser(title, language, test: bool = False) -> TMDBInfo | None:
|
||||
with RequestContent() as req:
|
||||
url = search_url(title)
|
||||
contents = req.get_json(url).get("results")
|
||||
@@ -86,8 +86,9 @@ def tmdb_parser(title, language) -> TMDBInfo | None:
|
||||
official_title = info_content.get("name")
|
||||
year_number = info_content.get("first_air_date").split("-")[0]
|
||||
if poster_path:
|
||||
img = req.get_content(f"https://image.tmdb.org/t/p/w780{poster_path}")
|
||||
poster_link = save_image(img, "jpg")
|
||||
if not test:
|
||||
img = req.get_content(f"https://image.tmdb.org/t/p/w780{poster_path}")
|
||||
poster_link = save_image(img, "jpg")
|
||||
else:
|
||||
poster_link = None
|
||||
return TMDBInfo(
|
||||
|
||||
Reference in New Issue
Block a user