Fix: test.

This commit is contained in:
EstrellaXD
2023-10-04 17:01:39 +08:00
parent fb721d25dc
commit 58e84812d0

View File

@@ -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(