Merge pull request #252 from XitaoLi/main

增加延时应对反扒,修复字符匹配的边界问题
This commit is contained in:
LibraHp_0928 2024-11-18 16:39:47 +08:00 committed by GitHub
commit 2b4c18b265
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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