fix bug
This commit is contained in:
parent
884a0feb62
commit
1ecbc2f0be
@ -417,10 +417,12 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
if imdbid:
|
if imdbid:
|
||||||
# 优先使用IMDBID查询
|
# 优先使用IMDBID查询
|
||||||
|
logger.info(f"开始使用IMDBID {imdbid} 查询豆瓣信息 ...")
|
||||||
result = self.doubanapi.imdbid(imdbid)
|
result = self.doubanapi.imdbid(imdbid)
|
||||||
if result:
|
if result:
|
||||||
return result
|
return result
|
||||||
# 搜索
|
# 搜索
|
||||||
|
logger.info(f"开始使用名称 {name} 查询豆瓣信息 ...")
|
||||||
result = self.doubanapi.search(f"{name} {year or ''}".strip())
|
result = self.doubanapi.search(f"{name} {year or ''}".strip())
|
||||||
if not result:
|
if not result:
|
||||||
logger.warn(f"未找到 {name} 的豆瓣信息")
|
logger.warn(f"未找到 {name} 的豆瓣信息")
|
||||||
|
@ -214,13 +214,14 @@ class DoubanApi(metaclass=Singleton):
|
|||||||
)
|
)
|
||||||
"""
|
"""
|
||||||
req_url = self._api_url + url
|
req_url = self._api_url + url
|
||||||
params = {'apiKey': self._api_key2}
|
params = {'apikey': self._api_key2}
|
||||||
if kwargs:
|
if kwargs:
|
||||||
params.update(kwargs)
|
params.update(kwargs)
|
||||||
if '_ts' in params:
|
if '_ts' in params:
|
||||||
params.pop('_ts')
|
params.pop('_ts')
|
||||||
resp = RequestUtils(
|
resp = RequestUtils(
|
||||||
session=self._session
|
ua=settings.USER_AGENT,
|
||||||
|
session=self._session,
|
||||||
).post_res(url=req_url, data=params)
|
).post_res(url=req_url, data=params)
|
||||||
if resp.status_code == 400 and "rate_limit" in resp.text:
|
if resp.status_code == 400 and "rate_limit" in resp.text:
|
||||||
return resp.json()
|
return resp.json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user