mirror of
https://github.com/LibraHp/GetQzonehistory.git
synced 2024-12-27 06:29:55 +00:00
增加延时应对反扒,修复字符匹配的边界问题
This commit is contained in:
parent
521aeeec33
commit
bf710423d9
@ -1,4 +1,5 @@
|
||||
import re
|
||||
import time
|
||||
from tqdm import tqdm
|
||||
import util.LoginUtil as Login
|
||||
import requests
|
||||
@ -62,6 +63,7 @@ def get_message(start, count):
|
||||
headers=headers,
|
||||
timeout=(5, 10) # 设置连接超时为5秒,读取超时为10秒
|
||||
)
|
||||
time.sleep(5)
|
||||
except requests.Timeout:
|
||||
print("请求超时")
|
||||
return None
|
||||
|
@ -243,8 +243,8 @@ def get_content_from_split(content):
|
||||
return content_split[1].strip() if len(content_split) > 1 else content.strip()
|
||||
|
||||
|
||||
# 判断两个字符串是否存在互相包含的情况
|
||||
# 判断两个字符串是否相等
|
||||
def is_any_mutual_exist(str1, str2):
|
||||
str1 = get_content_from_split(str1)
|
||||
str2 = get_content_from_split(str2)
|
||||
return str1 in str2 or str2 in str1
|
||||
return str1 == str2
|
||||
|
Loading…
Reference in New Issue
Block a user