From da80ad33d91d9c4acf730973f88ceb44d0a71d2d Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 29 Feb 2024 17:28:36 +0800 Subject: [PATCH] fix bug --- app/modules/themoviedb/scraper.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/modules/themoviedb/scraper.py b/app/modules/themoviedb/scraper.py index 99fffdd6..af60a0d0 100644 --- a/app/modules/themoviedb/scraper.py +++ b/app/modules/themoviedb/scraper.py @@ -1,4 +1,5 @@ import time +import traceback from pathlib import Path from typing import Union from xml.dom import minidom @@ -135,14 +136,15 @@ class TmdbScraper: file_path=file_path) # 集的图片 episode_image = episodeinfo.get("still_path") - image_path = file_path.with_name(file_path.stem + "-thumb.jpg").with_suffix( - Path(episode_image).suffix) - if episode_image and (self._force_img or not image_path.exists()): - self.__save_image( - f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{episode_image}", - image_path) + if episode_image: + image_path = file_path.with_name(file_path.stem + "-thumb.jpg").with_suffix( + Path(episode_image).suffix) + if self._force_img or not image_path.exists(): + self.__save_image( + f"https://{settings.TMDB_IMAGE_DOMAIN}/t/p/original{episode_image}", + image_path) except Exception as e: - logger.error(f"{file_path} 刮削失败:{str(e)}") + logger.error(f"{file_path} 刮削失败:{str(e)} - {traceback.format_exc()}") @staticmethod def __gen_common_nfo(mediainfo: MediaInfo, doc, root):