fix cython type error

This commit is contained in:
jxxghp
2025-03-23 21:39:37 +08:00
parent 740cf12c11
commit f9b0db623d
113 changed files with 812 additions and 779 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Tuple, List
from typing import Tuple, List, Optional
from app.core.config import settings
from app.db.systemconfig_oper import SystemConfigOper
@@ -73,7 +73,7 @@ class HddolbySpider:
self._searchurl = f"https://api.{self._domain_host}/api/v1/torrent/search"
self._pageurl = f"{self._domain}details.php?id=%s&hit=1"
def search(self, keyword: str, mtype: MediaType = None, page: int = 0) -> Tuple[bool, List[dict]]:
def search(self, keyword: str, mtype: MediaType = None, page: Optional[int] = 0) -> Tuple[bool, List[dict]]:
"""
搜索
"""
+2 -2
View File
@@ -1,7 +1,7 @@
import base64
import json
import re
from typing import Tuple, List
from typing import Tuple, List, Optional
from app.core.config import settings
from app.db.systemconfig_oper import SystemConfigOper
@@ -65,7 +65,7 @@ class MTorrentSpider:
self._token = indexer.get('token')
self._timeout = indexer.get('timeout') or 15
def search(self, keyword: str, mtype: MediaType = None, page: int = 0) -> Tuple[bool, List[dict]]:
def search(self, keyword: str, mtype: MediaType = None, page: Optional[int] = 0) -> Tuple[bool, List[dict]]:
"""
搜索
"""
+2 -2
View File
@@ -1,5 +1,5 @@
import re
from typing import Tuple, List
from typing import Tuple, List, Optional
from app.core.config import settings
from app.log import logger
@@ -49,7 +49,7 @@ class TNodeSpider:
if csrf_token:
self._token = csrf_token.group(1)
def search(self, keyword: str, page: int = 0) -> Tuple[bool, List[dict]]:
def search(self, keyword: str, page: Optional[int] = 0) -> Tuple[bool, List[dict]]:
if not self._token:
logger.warn(f"{self._name} 未获取到token,无法搜索")
return True, []
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import List, Tuple
from typing import List, Tuple, Optional
from urllib.parse import quote
from app.core.config import settings
@@ -23,7 +23,7 @@ class TorrentLeech:
self._proxy = settings.PROXY
self._timeout = indexer.get('timeout') or 15
def search(self, keyword: str, page: int = 0) -> Tuple[bool, List[dict]]:
def search(self, keyword: str, page: Optional[int] = 0) -> Tuple[bool, List[dict]]:
if StringUtils.is_chinese(keyword):
# 不支持中文
+2 -2
View File
@@ -1,4 +1,4 @@
from typing import Tuple, List
from typing import Tuple, List, Optional
from app.core.config import settings
from app.db.systemconfig_oper import SystemConfigOper
@@ -57,7 +57,7 @@ class YemaSpider:
self._ua = indexer.get('ua')
self._timeout = indexer.get('timeout') or 15
def search(self, keyword: str, mtype: MediaType = None, page: int = 0) -> Tuple[bool, List[dict]]:
def search(self, keyword: str, mtype: MediaType = None, page: Optional[int] = 0) -> Tuple[bool, List[dict]]:
"""
搜索
"""