本帖最后由 南岸 于 2021-3-22 16:23 编辑
禁止讨论机场地址!!!!!!!!!
禁止讨论机场地址!!!!!!!!!
禁止讨论机场地址!!!!!!!!!
基于项目https://github.com/zhjc1124/ssr_autocheckin 修改
sspanel自动签到脚本(腾讯云函数)
适用于Theme by editXY
其他主题无法使用按下图修改
问题已解决!
其他主题适配请issues
Tip:此流量不是手机运营商流量,是科{过}学{滤}上网的流量,懂得自然懂。机场地址填机场官网地址,不是填订阅的地址,注意这一点。有问题欢迎issues
用法
- 下载本仓库,将
main.py 上传到腾讯云函数
- 配置
main.py 中的init (如下)
def __init__(self):
# 机场地址
self.base_url = 'https://****.net'
# 登录信息
self.email = '****@qq.com'
self.password = '****'
# Server酱推送
self.sckey = 'SCU109245Tf34928bcea84db0a*************'
# 酷推qq推送
self.ktkey = '**********'
- 配置云函数定时触发
云函数运行截图
更新
- 20200915-第一个版本,支持签到、Server酱微信推送
- 20200917-修复非editXY主题运行时报错问题,增加酷推QQ推送
- 20210209-增加server酱Trubo版本推送企业微信,使用文档见https://mp.weixin.qq.com/s/IWrOncAqBpRVCJEHjbjbIA
- 20210221-增加Qmsg私聊推送
项目地址:https://github.com/icrons/ssp-sign
因为原账号被莫名其妙的封了。。。
代码如下
# -*- coding: utf-8 -*-
"""
@Time : 2020/9/15 9:52
@Auth : Ne-21
@Des : sspanel自动每日签到脚本
@File :sspanel_qd.py
@IDE :PyCharm
@Motto:Another me.
sspanel自动每日签到脚本,基于项目https://github.com/zhjc1124/ssr_autocheckin修改
"""
import requests
import re
requests.packages.urllib3.disable_warnings()
class SspanelQd(object):
def __init__(self):
# 机场地址
self.base_url = 'https://*****link'
# 登录信息
self.email = '******@qq.com'
self.password = '******'
# Server酱推送
self.sckey = ''
# 酷推qq推送
self.ktkey = ''
# ServerTurbo推送
self.SendKey = ''
# Qmsg私聊推送
self.QmsgKey = ''
def checkin(self):
email = self.email.split('@')
email = email[0] + '%40' + email[1]
password = self.password
try:
session = requests.session()
session.get(self.base_url, verify=False)
login_url = self.base_url + '/auth/login'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
}
post_data = 'email=' + email + '&passwd=' + password + '&code='
post_data = post_data.encode()
session.post(login_url, post_data, headers=headers, verify=False)
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
'Referer': self.base_url + '/user'
}
response = session.post(self.base_url + '/user/checkin', headers=headers, verify=False)
# print(response.text)
msg = (response.json()).get('msg')
print(msg)
except:
return False
info_url = self.base_url + '/user'
response = session.get(info_url, verify=False)
"""
以下只适配了editXY主题
"""
try:
level = re.findall(r'\["Class", "(.*?)"],', response.text)[0]
day = re.findall(r'\["Class_Expire", "(.*)"],', response.text)[0]
rest = re.findall(r'\["Unused_Traffic", "(.*?)"]', response.text)[0]
msg = "- 今日签到信息:"+str(msg)+"\n- 用户等级:"+str(level)+"\n- 到期时间:"+str(day)+"\n- 剩余流量:"+str(rest)
print(msg)
return msg
except:
return msg
#Qmsg私聊推送
def Qmsg_send(self, msg):
if self.QmsgKey == '':
return
qmsg_url = 'https://qmsg.zendee.cn/send/' + str(self.QmsgKey)
data = {
'msg': msg,
}
requests.post(qmsg_url, data=data)
# Server酱推送
def server_send(self, msg):
if self.SendKey == '':
return
server_url = "https://sctapi.ftqq.com/" + str(self.SendKey) + ".send"
data = {
'text': "今日的流量白嫖到啦!",
'desp': msg
}
requests.post(server_url, data=data)
# 酷推QQ推送
def kt_send(self, msg):
if self.ktkey == '':
return
kt_url = 'https://push.xuthus.cc/send/'+str(self.ktkey)
data = ('签到完成,点击查看详细信息~\n'+str(msg)).encode("utf-8")
requests.post(kt_url, data=data)
# Server酱推送
def serverTurbo_send(self, msg):
if self.sckey == '':
return
server_url = "https://sc.ftqq.com/" + str(self.sckey) + ".send"
data = {
'text': "签到完成,点击查看详细信息~",
'desp': msg
}
requests.post(server_url, data=data)
def main(self):
msg = self.checkin()
if msg == False:
print("网址不正确或网站禁止访问。")
else:
self.server_send(msg)
self.kt_send(msg)
self.serverTurbo_send(msg)
self.Qmsg_send(msg)
# 云函数入口
def main_handler(event, context):
run = SspanelQd()
run.main()
if __name__ == '__main__':
run = SspanelQd()
run.main()
|