fix:演职员刮削优化

1.豆瓣查询增加速率限制后重试
2.全中文演职员跳过处理
This commit is contained in:
olly
2023-10-08 14:00:55 +08:00
parent 9236b361e2
commit 7ea0c5ee4c
3 changed files with 79 additions and 87 deletions

View File

@ -173,7 +173,7 @@ class DoubanApi(metaclass=Singleton):
ts = params.pop(
'_ts',
int(datetime.strftime(datetime.now(), '%Y%m%d'))
datetime.strftime(datetime.now(), '%Y%m%d')
)
params.update({
'os_rom': 'android',
@ -185,6 +185,8 @@ class DoubanApi(metaclass=Singleton):
ua=choice(self._user_agents),
session=self._session
).get_res(url=req_url, params=params)
if resp.status_code == 400 and "rate_limit" in resp.text:
return resp.json()
return resp.json() if resp else {}
def search(self, keyword, start=0, count=20,