明天上青龙

This commit is contained in:
rm 2023-12-26 23:18:46 +08:00
parent a88b40d364
commit f0686cbfa7
3 changed files with 9 additions and 91 deletions

View File

@ -1,82 +0,0 @@
import os
import sys
import time
import requests
# 从 青龙面板 获取GlaDOS账号Cookie
def get_cookies():
if os.environ.get("GR_COOKIE"):
print("已获取并使用Env环境 Cookie")
if '&' in os.environ["GR_COOKIE"]:
cookies = os.environ["GR_COOKIE"].split('&')
elif '\n' in os.environ["GR_COOKIE"]:
cookies = os.environ["GR_COOKIE"].split('\n')
else:
cookies = [os.environ["GR_COOKIE"]]
else:
print("未获取到正确的GlaDOS账号Cookie")
return
print(f"共获取到{len(cookies)}个GlaDOS账号Cookie\n")
print(f"脚本执行时间(北京时区): {time.strftime('%Y/%m/%d %H:%M:%S', time.localtime())}\n")
return cookies
# 加载通知服务
def load_send():
cur_path = os.path.abspath(os.path.dirname(__file__))
sys.path.append(cur_path)
if os.path.exists(cur_path + "/sendNotify.py"):
print("发送消息!")
# try:
# from sendNotify import send
# return send
# except Exception as e:
# print(f"加载通知服务失败:{e}")
# return None
else:
print("加载通知服务失败")
return None
'''
PT 网站自动签
'''
attendances = {
"https://www.icc2022.com": "c_secure_uid=MTk0OTI%3D; c_secure_pass=d7f655d5b8e90739f23620b9d24241e1; c_secure_ssl=eWVhaA%3D%3D; c_secure_tracker_ssl=eWVhaA%3D%3D; c_secure_login=bm9wZQ%3D%3D; PHPSESSID=em8dtq7r0t77tt1e0aq4m0of1o",
"https://hdmayi.com": "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",
"https://www.pttime.org": "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",
}
for key, value in attendances.items():
res_txt = f"开始对 [{key}] 进行签到操作...,签到结果:"
headers = {
'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'accept-language': 'zh,zh-CN;q=0.9',
'cache-control': 'max-age=0',
'cookie': value,
'sec-ch-ua': '"Google Chrome";v="119", "Chromium";v="119", "Not?A_Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"macOS"',
'sec-fetch-dest': 'document',
'sec-fetch-mode': 'navigate',
'sec-fetch-site': 'same-origin',
'sec-fetch-user': '?1',
'upgrade-insecure-requests': '1',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36',
}
request_url = key + "/attendance.php"
for _ in range(5):
try:
response_result = requests.get(request_url, headers=headers)
print(response_result.text)
if '签到成功' in response_result.text or '已签到' in response_result.text:
res_txt = res_txt + '签到成功!'
break
except Exception as e:
res_txt = res_txt + '签到出错!'
time.sleep(1)
else:
print(f"5次出现错误请关注")
print(res_txt)

View File

@ -8,11 +8,6 @@ import requests
import toml
from bs4 import BeautifulSoup
'''
new Env('PT自动签到和注册检测');
8 8 2 1 * https://raw.githubusercontent.com/6dylan6/auto_comment/main/jd_comment.py
'''
class PtOperation:
@ -140,7 +135,3 @@ class PtOperation:
print(f"Error: The file '{self.toml_file}' was not found.")
except toml.TomlDecodeError as e:
print(f"Error decoding TOML: {e}")
if __name__ == '__main__':
PtOperation().opt()

View File

@ -0,0 +1,9 @@
from PT.pt_operation import PtOperation
'''
new Env('PT自动签到和注册检测');
8 8 2 1 *
'''
if __name__ == '__main__':
PtOperation().opt()