From 25e0c25bc65916246cba245072dc2145dd2143cd Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 25 Mar 2024 23:01:50 +0800 Subject: [PATCH] fix timeout --- README.md | 2 +- app/core/config.py | 2 +- app/helper/browser.py | 2 +- app/modules/indexer/mtorrent.py | 4 ++-- app/modules/indexer/spider.py | 2 +- app/modules/indexer/tnode.py | 2 +- app/modules/indexer/torrentleech.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8b6753e1..b08d262e 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ MoviePilot需要配套下载器和媒体服务器配合使用。 --- - **DOWNLOAD_SUBTITLE:** 下载站点字幕,`true`/`false`,默认`true` --- -- **SEARCH_MULTIPLE_NAME:** 搜索时是否使用多个名称搜索,`true`/`false`,默认`true`,开启后会使用多个名称进行搜索,搜索结果会更全面,但会增加搜索时间;关闭时只要其中一个名称搜索到结果或全部名称搜索完毕即停止 +- **SEARCH_MULTIPLE_NAME:** 搜索时是否使用多个名称搜索,`true`/`false`,默认`false`,开启后会使用多个名称进行搜索,搜索结果会更全面,但会增加搜索时间;关闭时只要其中一个名称搜索到结果或全部名称搜索完毕即停止 --- - **MOVIE_RENAME_FORMAT:** 电影重命名格式,基于jinjia2语法 diff --git a/app/core/config.py b/app/core/config.py index 07f6d87b..2f075d9e 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -237,7 +237,7 @@ class Settings(BaseSettings): # 是否启用DOH解析域名 DOH_ENABLE: bool = True # 搜索多个名称 - SEARCH_MULTIPLE_NAME: bool = True + SEARCH_MULTIPLE_NAME: bool = False @validator("SUBSCRIBE_RSS_INTERVAL", "COOKIECLOUD_INTERVAL", diff --git a/app/helper/browser.py b/app/helper/browser.py index bcaec4a9..00e6534c 100644 --- a/app/helper/browser.py +++ b/app/helper/browser.py @@ -61,7 +61,7 @@ class PlaywrightHelper: ua: str = None, proxies: dict = None, headless: bool = False, - timeout: int = 30) -> str: + timeout: int = 20) -> str: """ 获取网页源码 :param url: 网页地址 diff --git a/app/modules/indexer/mtorrent.py b/app/modules/indexer/mtorrent.py index dae9bb1e..cbd25825 100644 --- a/app/modules/indexer/mtorrent.py +++ b/app/modules/indexer/mtorrent.py @@ -76,7 +76,7 @@ class MTorrentSpider: ua=self._ua, proxies=self._proxy, referer=f"{self._domain}usercp?tab=laboratory", - timeout=30 + timeout=15 ).post_res(url=f"{self._domain}api/apikey/getKeyList") if res and res.status_code == 200: api_keys = res.json().get('data') @@ -125,7 +125,7 @@ class MTorrentSpider: }, proxies=self._proxy, referer=f"{self._domain}browse", - timeout=30 + timeout=15 ).post_res(url=self._searchurl, json=params) torrents = [] if res and res.status_code == 200: diff --git a/app/modules/indexer/spider.py b/app/modules/indexer/spider.py index afb60544..265f0dde 100644 --- a/app/modules/indexer/spider.py +++ b/app/modules/indexer/spider.py @@ -95,7 +95,7 @@ class TorrentSpider: self.render = indexer.get('render') self.domain = indexer.get('domain') self.result_num = int(indexer.get('result_num') or 100) - self._timeout = int(indexer.get('timeout') or 30) + self._timeout = int(indexer.get('timeout') or 15) self.page = page if self.domain and not str(self.domain).endswith("/"): self.domain = self.domain + "/" diff --git a/app/modules/indexer/tnode.py b/app/modules/indexer/tnode.py index 2d7f89d9..28d76e1c 100644 --- a/app/modules/indexer/tnode.py +++ b/app/modules/indexer/tnode.py @@ -77,7 +77,7 @@ class TNodeSpider: }, cookies=self._cookie, proxies=self._proxy, - timeout=30 + timeout=15 ).post_res(url=self._searchurl, json=params) torrents = [] if res and res.status_code == 200: diff --git a/app/modules/indexer/torrentleech.py b/app/modules/indexer/torrentleech.py index de5c6a40..741b24d0 100644 --- a/app/modules/indexer/torrentleech.py +++ b/app/modules/indexer/torrentleech.py @@ -40,7 +40,7 @@ class TorrentLeech: }, cookies=self._indexer.get('cookie'), proxies=self._proxy, - timeout=30 + timeout=15 ).get_res(url) torrents = [] if res and res.status_code == 200: