更新站点

This commit is contained in:
rm 2023-12-27 13:25:12 +08:00
parent 3d158a8127
commit e6f0f34f16
2 changed files with 10 additions and 9 deletions

View File

@ -62,7 +62,7 @@ label = "游戏、综艺、电子书、windows软件"
# ===========================【start】 9kg 站点 【start】===========================
[pttime]
url = "https://www.pttime.com"
url = "https://www.pttime.org"
cookie = "c_lang_folder=chs; c_secure_uid=OTExNDU%3D; c_secure_pass=b4567a9950c3906657ed8baeb5a39b2d; c_secure_ssl=eWVhaA%3D%3D; c_secure_tracker_ssl=eWVhaA%3D%3D; c_secure_login=bm9wZQ%3D%3D; cf_clearance=RtffM86J.2AMKNqMKcF5WTGWOK11V7gklzY2rDRNu24-1701826018-0-1-d71c894c.1d67b4d8.801dd6ac-0.2.1701826018"
level = 2
label = "9kg"
@ -139,7 +139,7 @@ level = 3
label = "动漫、综艺、电视剧"
[hdmayi]
url = "https://www.hdmayi.com"
url = "https://hdmayi.com"
cookie = "Hm_lvt_6d8ca12c6bcfbd37eefefe2acf29b40d=1701424866; c_secure_uid=MjcyODg%3D; c_secure_pass=4e745ac26cb64631db97c605af6eef25; c_secure_ssl=eWVhaA%3D%3D; c_secure_tracker_ssl=eWVhaA%3D%3D; c_secure_login=bm9wZQ%3D%3D; Hm_lpvt_6d8ca12c6bcfbd37eefefe2acf29b40d=1701832678"
level = 4

View File

@ -46,15 +46,15 @@ class PtOperation:
for _ in range(5):
try:
response_result = requests.get(request_url, headers=self.headers)
print(f"{section_name} 请求:{response_result.status_code} 结果:{response_result.text}")
if '签到成功' in response_result.text or '已签到' in response_result.text:
res_txt = res_txt + '签到成功!'
logger.info(res_txt)
break
except Exception as e:
res_txt = res_txt + '签到出错!'
time.sleep(1)
time.sleep(2)
else:
logger.error(f"5次出现错误请关注")
logger.info(res_txt)
logger.error(f"{res_txt} 5次出现错误请关注")
def signup(self, section_name, url):
"""
@ -84,18 +84,17 @@ class PtOperation:
for _ in range(5):
try:
response = requests.get(url, headers=self.headers, timeout=60)
print(response.status_code)
if response.status_code == 403 or response.text in "Just a moment":
return self.flaresolverr_get(url, text)
elif response.status_code == 200:
return response.text
else:
logger.error(f"{text} , 出现错误code码是{response.status_code}, {response.text}")
return ""
except Exception as e:
time.sleep(2)
else:
logger.error(f"{text} , 5次出现错误无法访问")
return ""
def flaresolverr_get(self, url, text):
for _ in range(5):
@ -117,6 +116,7 @@ class PtOperation:
time.sleep(2)
else:
logger.error(f"{text} , 5次出现错误无法访问")
return ""
def opt(self):
try:
@ -131,7 +131,8 @@ class PtOperation:
self.attendances(section_name, url, cookie)
else:
# 检测是否可以注册
self.signup(section_name, url)
# self.signup(section_name, url)
pass
except FileNotFoundError:
print(f"Error: The file '{self.toml_file}' was not found.")
except toml.TomlDecodeError as e: