From 361e8dd65d3ae13d50e2c1725c2093152af3bfd1 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 21 Jun 2024 23:25:08 +0800 Subject: [PATCH] fix api --- app/helper/aliyun.py | 7 ++++++- app/modules/themoviedb/scraper.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helper/aliyun.py b/app/helper/aliyun.py index 083bf993..c0a13239 100644 --- a/app/helper/aliyun.py +++ b/app/helper/aliyun.py @@ -578,7 +578,12 @@ class AliyunHelper: # 上传地址 upload_url = part_info_list[0].get("upload_url") # 上传文件 - res = RequestUtils(headers=headers).put_res(upload_url, data=file_path.read_bytes()) + res = RequestUtils(headers={ + "Content-Type": "", + "User-Agent": settings.USER_AGENT, + "Referer": "https://www.alipan.com/", + "Accept": "*/*", + }).put_res(upload_url, data=file_path.read_bytes()) if not res: self.__handle_error(res, "上传文件") return None diff --git a/app/modules/themoviedb/scraper.py b/app/modules/themoviedb/scraper.py index 7984bd69..311e41d4 100644 --- a/app/modules/themoviedb/scraper.py +++ b/app/modules/themoviedb/scraper.py @@ -276,7 +276,8 @@ class TmdbScraper: :param dir_path: 电视剧根目录 """ # 开始生成XML - logger.info(f"正在生成电视剧NFO文件:{dir_path.name}") + if dir_path: + logger.info(f"正在生成电视剧NFO文件:{dir_path.name}") doc = minidom.Document() root = DomUtils.add_node(doc, doc, "tvshow") # 公共部分