feat 索引支持imdbid,但暂不启用

This commit is contained in:
jxxghp
2023-08-13 17:09:02 +08:00
parent ad00c74c6e
commit 762c477c16
4 changed files with 39 additions and 10 deletions

View File

@ -49,15 +49,16 @@ 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, imdbid: str = None, page: int = 0) -> Tuple[bool, List[dict]]:
if not self._token:
logger.warn(f"{self._name} 未获取到token无法搜索")
return True, []
search_type = "imdbid" if imdbid else "title"
params = {
"page": int(page) + 1,
"size": self._size,
"type": "title",
"keyword": keyword or "",
"type": search_type,
"keyword": imdbid or keyword or "",
"sorter": "id",
"order": "desc",
"tags": [],