fix #777 豆瓣流控改为随机休眠3-10秒

This commit is contained in:
jxxghp 2023-10-10 16:02:14 +08:00
parent 93c473afe7
commit 4d900c2eb0
2 changed files with 5 additions and 3 deletions

View File

@ -449,7 +449,7 @@ class DoubanSync(_PluginBase):
results = self.rsshelper.parse(url) results = self.rsshelper.parse(url)
if not results: if not results:
logger.error(f"未获取到用户 {user_id} 豆瓣RSS数据{url}") logger.error(f"未获取到用户 {user_id} 豆瓣RSS数据{url}")
return continue
# 解析数据 # 解析数据
for result in results: for result in results:
try: try:

View File

@ -581,8 +581,10 @@ class PersonMeta(_PluginBase):
""" """
获取豆瓣演员信息 获取豆瓣演员信息
""" """
# 随机休眠1-5秒 # 随机休眠 3-10 秒
time.sleep(1 + int(time.time()) % 5) sleep_time = 3 + int(time.time()) % 7
logger.info(f"随机休眠 {sleep_time}秒 ...")
time.sleep(sleep_time)
# 匹配豆瓣信息 # 匹配豆瓣信息
doubaninfo = self.chain.match_doubaninfo(name=mediainfo.title, doubaninfo = self.chain.match_doubaninfo(name=mediainfo.title,
mtype=mediainfo.type.value, mtype=mediainfo.type.value,