From b14b41c2c1fd26981b6d68e36bf5d68e1b9c4600 Mon Sep 17 00:00:00 2001 From: thsrite Date: Thu, 7 Mar 2024 09:20:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E7=B3=BB=E7=BB=9F=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E6=A3=80=E6=9F=A5tmdb=E3=80=81tvdb=E8=B5=B0=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/themoviedb/__init__.py | 3 ++- app/modules/thetvdb/__init__.py | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/modules/themoviedb/__init__.py b/app/modules/themoviedb/__init__.py index c23f44a0..86cb5e2f 100644 --- a/app/modules/themoviedb/__init__.py +++ b/app/modules/themoviedb/__init__.py @@ -43,7 +43,8 @@ class TheMovieDbModule(_ModuleBase): """ 测试模块连接性 """ - ret = RequestUtils().get_res(f"https://{settings.TMDB_API_DOMAIN}/3/movie/550?api_key={settings.TMDB_API_KEY}") + ret = RequestUtils(proxies=settings.PROXY).get_res( + f"https://{settings.TMDB_API_DOMAIN}/3/movie/550?api_key={settings.TMDB_API_KEY}") if ret and ret.status_code == 200: return True, "" elif ret: diff --git a/app/modules/thetvdb/__init__.py b/app/modules/thetvdb/__init__.py index 750dc5db..4e41322a 100644 --- a/app/modules/thetvdb/__init__.py +++ b/app/modules/thetvdb/__init__.py @@ -1,6 +1,5 @@ from typing import Optional, Tuple, Union - from app.core.config import settings from app.log import logger from app.modules import _ModuleBase @@ -9,7 +8,6 @@ from app.utils.http import RequestUtils class TheTvDbModule(_ModuleBase): - tvdb: tvdbapi.Tvdb = None def init_module(self) -> None: @@ -25,7 +23,7 @@ class TheTvDbModule(_ModuleBase): """ 测试模块连接性 """ - ret = RequestUtils().get_res("https://api.thetvdb.com/series/81189") + ret = RequestUtils(proxies=settings.PROXY).get_res("https://api.thetvdb.com/series/81189") if ret and ret.status_code == 200: return True, "" elif ret: