当你们打开这篇文章的时候,大概率是已经配置好环境了,如果没有配置好青龙环境,看我之前的文章,安装docker、青龙和青龙卸载更新,lxc安装docker青龙,安装ubuntu-server系统等。
拉库指令
国内机用下面指令(带代理):
ql repo https://js.nbplay.site/https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify"
国外机(无需代理)用下面指令:
ql repo https://github.com/6dylan6/jdpro.git "jd_|jx_|jddj_" "backUp" "^jd[^_]|USER|JD|function|sendNotify"
使用流程
1、青龙部署。
2、登录青龙配置管理config.sh修改,差不多在17行(特别注意,没有修改此配置,任务拉不全,一键部署可忽略此处);
RepoFileExtensions="js py"修改为 RepoFileExtensions=“js py sh ts” 保存;
3、新建拉库任务或订阅,并执行,刷新浏览器即可看到添加的任务;
4、添加CK环境变量,多CK不要写在一起,每个都新建JD_COOKIE变量;
5,通知key变量请添加到配置管理config.sh文件,否则收不到通知;
支持的通知方式
server酱,go-cqhttp,pushdeer,Bark App,tg bot,钉钉bot,企业微信bot,企业微信应用消息,飞书,iGot,push plus,WxPusher,gotify
请在配置管理config文件里写变量
github地址
评价:脚本很多,但是好多失效脚本
拉库指令
ql repo https://github.com/gys619/Absinthe.git “jd_|jx_|jddj_|gua_|jddj_|getJDCookie|wskey” “activity|backUp” “^jd[^_]|USER|utils|ZooFaker|JDJRValidator_|^sign|jddj_cookie|function|ql” “main”
拉库指令
ql repo https://github.com/shufflewzc/faker2.git “jd_|jx_|gua_|jddj_|jdCookie” “activity|backUp” “^jd[^_]|USER|function|utils|sendNotify|ZooFaker_Necklace.js|JDJRValidator_|sign_graphics_validate|ql|JDSignValidator” “main”
助力池版
日常任务带有助力池,助力池助力量充足,相互助力。
拉库指令
ql repo https://github.com/shufflewzc/faker3.git “jd_|jx_|gua_|jddj_|jdCookie” “activity|backUp” “^jd[^_]|USER|function|utils|sendNotify|ZooFaker_Necklace.js|JDJRValidator_|sign_graphics_validate|ql|JDSignValidator” “main”
纯净版
无任何自带助力码。
拉库指令
ql repo https://github.com/Akali5/jd-depot.git "jd_|jx_|jddj_|gua_|getJDCookie|wskey" "activity|backUp" "^jd[^_]|USER|utils|ZooFaker_Necklace|JDJRValidator_|sign_graphics_validate|jddj_cookie|function|ql|magic|JDJR|sendNotify|depend|h5|jdspider"
拉库指令
ql repo https://github.com/KingRan/KR.git "jd_|jx_|jdCookie" "activity|backUp" "^jd[^_]|USER|utils|function|sign|sendNotify|ql|JDJR"
签到脚本的使用教程:
可以在青龙脚本下面新建新的文件夹
copy一个notify.py
,主要用于pushplus推送消息用
脚本需要的环境变量,在环境变量里面设置
重点
:确保import 的库依赖已经安装,否则会报错,没有安装去依赖里面安装即可
命令必须task
开头 后面跟着是现金脚本的路径
大概一个多月就得重新更新一次token,会显示签到失败
#!/usr/bin/python3
# -- coding: utf-8 --
# @Time : 2023/4/8 10:23
# -------------------------------
# cron "30 5 * * *" script-path=xxx.py,tag=匹配cron用
# const $ = new Env('阿里云盘签到');
import json
import requests
import os
import notify
##变量export ali_refresh_token=''
ali_refresh_token=os.getenv("ali_refresh_token").split('&')
#refresh_token是一成不变的呢,我们使用它来更新签到需要的access_token
#refresh_token获取教程:https://github.com/bighammer-link/Common-scripts/wiki/%E9%98%BF%E9%87%8C%E4%BA%91%E7%9B%98refresh_token%E8%8E%B7%E5%8F%96%E6%96%B9%E6%B3%95
# ali_refresh_token = os.getenv("ali_refresh_token")
#签到函数
for i in range(len(ali_refresh_token)):
print(f'开始帐号{i+1}签到')
def daily_check(access_token):
url = 'https://member.aliyundrive.com/v1/activity/sign_in_list'
headers = {
'Authorization': access_token
}
response = requests.post(url=url, headers=headers, json={}).text
result = json.loads(response)
if 'success' in result:
print('签到成功')
for i, j in enumerate(result['result']['signInLogs']):
if j['status'] == 'miss':
day_json = result['result']['signInLogs'][i-1]
# print(day_json)
if not day_json['isReward']:
contents = '签到成功,今日未获得奖励'
else:
contents = '本月累计签到{}天,今日签到获得{}{}'.format(result['result']['signInCount'],
day_json['reward']['name'],
day_json['reward']['description'])
print(contents)
return contents
# 使用refresh_token更新access_token
def update_token(refresh_token):
url = 'https://auth.aliyundrive.com/v2/account/token'
data = {
'grant_type': 'refresh_token',
'refresh_token': ali_refresh_token[i]
}
response = requests.post(url=url, json=data).json()
access_token = response['access_token']
# print('获取的access_token为{}'.format(access_token))
return access_token
def main():
# print('更新access_token')
access_token = update_token(ali_refresh_token)
# print('更新成功,开始进行签到')
content = daily_check(access_token)
notify.send("阿里云盘签到", content)
if __name__ == '__main__':
main()
在环境变量里面设置
ali_refresh_toke
获取阿里云盘的ali_refresh_toke教程:
方法一:
网页登录阿里云盘,键盘
F12
,刷新一下网页,然后找到如下:
方法二
F12
下找到控制台
,输入命令,弹窗显示refresh_token
alert(JSON.parse(localStorage.token).refresh_token)
采用订阅的方式,订阅地址如下:
https://github.com/mrabit/aliyundriveDailyCheck.git
采用的是BiliBiliToolPro
,来源github
青龙面板,配置文件页。
修改 RepoFileExtensions=“js py” 为 RepoFileExtensions=“js py sh”
保存配置。
两种方式:
名称:Bilibili
类型:公开仓库
链接:https://github.com/RayWangQvQ/BiliBiliToolPro.git
定时类型:crontab
定时规则:2 2 28 * *
白名单:bili_task_.+.sh
文件后缀:sh
没提到的不要动。
保存后,点击运行按钮,运行拉库。
青龙面板,定时任务页,右上角添加任务,填入以下信息:
名称:拉取Bili库
命令:ql repo https://github.com/RayWangQvQ/BiliBiliToolPro.git “bili_task_”
定时规则:2 2 28 * *
点击确定。
保存成功后,找到该定时任务,点击运行按钮,运行拉库。
如果正常,拉库成功后,同时也会自动添加bilibili相关的task任务。
在青龙定时任务中,点击运行bili扫码登录任务,查看运行日志,扫描日志中的二维码进行登录。
登录成功后,会将cookie保存到青龙的环境变量中:
首次运行会自动安装dotnet环境,时间久点,之后就不需要重复安装了。
说明,采用的方式为订阅,会每天自动拉取脚本,第一次运行会比较慢,等待即可。
需要配置通知,默认不发送通知
这里讲解配置pushplus的方式,如果采用其他推送方式可以自行查阅文档地址,或者找我一起学习。
TITLE | CONTENT |
---|---|
配置Key | Serilog:WriteTo:9:Args:token |
值域 | 一串字符串 |
默认值 | 空 |
环境变量 | Ray_Serilog__WriteTo__9__Args__token |
GitHub Secrets | PUSHPLUSTOKEN |
TITLE | CONTENT |
---|---|
配置Key | Serilog:WriteTo:9:Args:topic |
值域 | 一串字符串 |
默认值 | 空 |
环境变量 | Ray_Serilog__WriteTo__9__Args__topic |
GitHub Secrets | PUSHPLUSTOPIC |
一般来说,这两个配置就够用了,如果需要更详细的配置,可以自行查阅文档。
配置完成的截图如上。
# 来自吾爱论坛,在原作者的基础上把推送消息换成了青龙自带的通知,如有侵权请告知,将立即删除。
# @author Sten
# 我的仓库:https://github.com/aefa6/QinglongScript.git
# 觉得不错麻烦点个star谢谢
import notify
import time
import re
import json
import base64
import hashlib
import urllib.parse,hmac
import rsa
import requests
import random
BI_RM = list("0123456789abcdefghijklmnopqrstuvwxyz")
B64MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
s = requests.Session()
# 在下面两行的引号内贴上账号(仅支持手机号)和密码
username = "xxxxxx"
password = "xxxxxx"
_ = """
if(username == "" or password == ""):
username = input("账号:")
password = input("密码:")
# """
assert username and password, "在第23、24行填入有效账号和密码"
def int2char(a):
return BI_RM[a]
def b64tohex(a):
d = ""
e = 0
c = 0
for i in range(len(a)):
if list(a)[i] != "=":
v = B64MAP.index(list(a)[i])
if 0 == e:
e = 1
d += int2char(v >> 2)
c = 3 & v
elif 1 == e:
e = 2
d += int2char(c << 2 | v >> 4)
c = 15 & v
elif 2 == e:
e = 3
d += int2char(c)
d += int2char(v >> 2)
c = 3 & v
else:
e = 0
d += int2char(c << 2 | v >> 4)
d += int2char(15 & v)
if e == 1:
d += int2char(c << 2)
return d
def rsa_encode(j_rsakey, string):
rsa_key = f"-----BEGIN PUBLIC KEY-----\n{j_rsakey}\n-----END PUBLIC KEY-----"
pubkey = rsa.PublicKey.load_pkcs1_openssl_pem(rsa_key.encode())
result = b64tohex((base64.b64encode(rsa.encrypt(f'{string}'.encode(), pubkey))).decode())
return result
def calculate_md5_sign(params):
return hashlib.md5('&'.join(sorted(params.split('&'))).encode('utf-8')).hexdigest()
def login(username, password):
#https://m.cloud.189.cn/login2014.jsp?redirectURL=https://m.cloud.189.cn/zhuanti/2021/shakeLottery/index.html
url=""
urlToken="https://m.cloud.189.cn/udb/udb_login.jsp?pageId=1&pageKey=default&clientType=wap&redirectURL=https://m.cloud.189.cn/zhuanti/2021/shakeLottery/index.html"
s = requests.Session()
r = s.get(urlToken)
pattern = r"https?://[^\s'\"]+" # 匹配以http或https开头的url
match = re.search(pattern, r.text) # 在文本中搜索匹配
if match: # 如果找到匹配
url = match.group() # 获取匹配的字符串
# print(url) # 打印url
else: # 如果没有找到匹配
print("没有找到url")
r = s.get(url)
# print(r.text)
pattern = r"]*href=\"([^\"]+)\"" # 匹配id为j-tab-login-link的a标签,并捕获href引号内的内容
match = re.search(pattern, r.text) # 在文本中搜索匹配
if match: # 如果找到匹配
href = match.group(1) # 获取捕获的内容
# print("href:" + href) # 打印href链接
else: # 如果没有找到匹配
print("没有找到href链接")
r = s.get(href)
captchaToken = re.findall(r"captchaToken' value='(.+?)'", r.text)[0]
lt = re.findall(r'lt = "(.+?)"', r.text)[0]
returnUrl = re.findall(r"returnUrl= '(.+?)'", r.text)[0]
paramId = re.findall(r'paramId = "(.+?)"', r.text)[0]
j_rsakey = re.findall(r'j_rsaKey" value="(\S+)"', r.text, re.M)[0]
s.headers.update({"lt": lt})
username = rsa_encode(j_rsakey, username)
password = rsa_encode(j_rsakey, password)
url = "https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do"
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/76.0',
'Referer': 'https://open.e.189.cn/',
}
data = {
"appKey": "cloud",
"accountType": '01',
"userName": f"{{RSA}}{username}",
"password": f"{{RSA}}{password}",
"validateCode": "",
"captchaToken": captchaToken,
"returnUrl": returnUrl,
"mailSuffix": "@189.cn",
"paramId": paramId
}
r = s.post(url, data=data, headers=headers, timeout=5)
if (r.json()['result'] == 0):
print(r.json()['msg'])
else:
print(r.json()['msg'])
redirect_url = r.json()['toUrl']
r = s.get(redirect_url)
return s
def main():
s=login(username, password)
rand = str(round(time.time() * 1000))
surl = f'https://api.cloud.189.cn/mkt/userSign.action?rand={rand}&clientType=TELEANDROID&version=8.6.3&model=SM-G930K'
url = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN&activityId=ACT_SIGNIN'
url2 = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN_PHOTOS&activityId=ACT_SIGNIN'
url3 = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_2022_FLDFS_KJ&activityId=ACT_SIGNIN'
headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6',
"Referer": "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
"Host": "m.cloud.189.cn",
"Accept-Encoding": "gzip, deflate",
}
response = s.get(surl, headers=headers)
netdiskBonus = response.json()['netdiskBonus']
if (response.json()['isSign'] == "false"):
print(f"未签到,签到获得{netdiskBonus}M空间")
res1 = f"未签到,签到获得{netdiskBonus}M空间"
else:
print(f"已经签到过了,签到获得{netdiskBonus}M空间")
res1 = f"已经签到过了,签到获得{netdiskBonus}M空间"
headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6',
"Referer": "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
"Host": "m.cloud.189.cn",
"Accept-Encoding": "gzip, deflate",
}
response = s.get(url, headers=headers)
if ("errorCode" in response.text):
print(response.text)
res2 = ""
else:
description = response.json()['description']
print(f"抽奖获得{description}")
res2 = f"抽奖获得{description}"
response = s.get(url2, headers=headers)
if ("errorCode" in response.text):
print(response.text)
res3 = ""
else:
description = response.json()['description']
print(f"抽奖获得{description}")
res3 = f"抽奖获得{description}"
response = s.get(url3, headers=headers)
if ("errorCode" in response.text):
print(response.text)
res4 = ""
else:
description = response.json()['description']
print(f"链接3抽奖获得{description}")
res4 = f"链接3抽奖获得{description}"
title = "天翼云签到"
content = f"""
{res1}
{res2}
{res3}
{res4}
"""
notify.send(title, content)
def lambda_handler(event, context): # aws default
main()
def main_handler(event, context): # tencent default
main()
def handler(event, context): # aliyun default
main()
if __name__ == "__main__":
# time.sleep(random.randint(5, 30))
main()
# 来自吾爱论坛,在原作者的基础上把推送消息换成了青龙自带的通知,如有侵权请告知,将立即删除。
# @author Sten
# 我的仓库:https://github.com/aefa6/QinglongScript.git
# 觉得不错麻烦点个star谢谢
import notify
import time
import re
import json
import base64
import hashlib
import urllib.parse,hmac
import rsa
import requests
import random
import os
BI_RM = list("0123456789abcdefghijklmnopqrstuvwxyz")
B64MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
s = requests.Session()
# 在下面两行的引号内贴上账号(仅支持手机号)和密码
# username = "15612510963"
# password = "Gao15227020648an"
username = os.getenv("cloud189_username")
password = os.getenv("cloud189_password")
_ = """
if(username == "" or password == ""):
username = input("账号:")
password = input("密码:")
# """
assert username and password, "在第23、24行填入有效账号和密码"
def int2char(a):
return BI_RM[a]
def b64tohex(a):
d = ""
e = 0
c = 0
for i in range(len(a)):
if list(a)[i] != "=":
v = B64MAP.index(list(a)[i])
if 0 == e:
e = 1
d += int2char(v >> 2)
c = 3 & v
elif 1 == e:
e = 2
d += int2char(c << 2 | v >> 4)
c = 15 & v
elif 2 == e:
e = 3
d += int2char(c)
d += int2char(v >> 2)
c = 3 & v
else:
e = 0
d += int2char(c << 2 | v >> 4)
d += int2char(15 & v)
if e == 1:
d += int2char(c << 2)
return d
def rsa_encode(j_rsakey, string):
rsa_key = f"-----BEGIN PUBLIC KEY-----\n{j_rsakey}\n-----END PUBLIC KEY-----"
pubkey = rsa.PublicKey.load_pkcs1_openssl_pem(rsa_key.encode())
result = b64tohex((base64.b64encode(rsa.encrypt(f'{string}'.encode(), pubkey))).decode())
return result
def calculate_md5_sign(params):
return hashlib.md5('&'.join(sorted(params.split('&'))).encode('utf-8')).hexdigest()
def login(username, password):
#https://m.cloud.189.cn/login2014.jsp?redirectURL=https://m.cloud.189.cn/zhuanti/2021/shakeLottery/index.html
url=""
urlToken="https://m.cloud.189.cn/udb/udb_login.jsp?pageId=1&pageKey=default&clientType=wap&redirectURL=https://m.cloud.189.cn/zhuanti/2021/shakeLottery/index.html"
s = requests.Session()
r = s.get(urlToken)
pattern = r"https?://[^\s'\"]+" # 匹配以http或https开头的url
match = re.search(pattern, r.text) # 在文本中搜索匹配
if match: # 如果找到匹配
url = match.group() # 获取匹配的字符串
# print(url) # 打印url
else: # 如果没有找到匹配
print("没有找到url")
r = s.get(url)
# print(r.text)
pattern = r"]*href=\"([^\"]+)\"" # 匹配id为j-tab-login-link的a标签,并捕获href引号内的内容
match = re.search(pattern, r.text) # 在文本中搜索匹配
if match: # 如果找到匹配
href = match.group(1) # 获取捕获的内容
# print("href:" + href) # 打印href链接
else: # 如果没有找到匹配
print("没有找到href链接")
r = s.get(href)
captchaToken = re.findall(r"captchaToken' value='(.+?)'", r.text)[0]
lt = re.findall(r'lt = "(.+?)"', r.text)[0]
returnUrl = re.findall(r"returnUrl= '(.+?)'", r.text)[0]
paramId = re.findall(r'paramId = "(.+?)"', r.text)[0]
j_rsakey = re.findall(r'j_rsaKey" value="(\S+)"', r.text, re.M)[0]
s.headers.update({"lt": lt})
username = rsa_encode(j_rsakey, username)
password = rsa_encode(j_rsakey, password)
url = "https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do"
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/76.0',
'Referer': 'https://open.e.189.cn/',
}
data = {
"appKey": "cloud",
"accountType": '01',
"userName": f"{{RSA}}{username}",
"password": f"{{RSA}}{password}",
"validateCode": "",
"captchaToken": captchaToken,
"returnUrl": returnUrl,
"mailSuffix": "@189.cn",
"paramId": paramId
}
r = s.post(url, data=data, headers=headers, timeout=5)
if (r.json()['result'] == 0):
print(r.json()['msg'])
else:
print(r.json()['msg'])
redirect_url = r.json()['toUrl']
r = s.get(redirect_url)
return s
def main():
s=login(username, password)
rand = str(round(time.time() * 1000))
surl = f'https://api.cloud.189.cn/mkt/userSign.action?rand={rand}&clientType=TELEANDROID&version=8.6.3&model=SM-G930K'
url = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN&activityId=ACT_SIGNIN'
url2 = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN_PHOTOS&activityId=ACT_SIGNIN'
url3 = f'https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_2022_FLDFS_KJ&activityId=ACT_SIGNIN'
headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6',
"Referer": "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
"Host": "m.cloud.189.cn",
"Accept-Encoding": "gzip, deflate",
}
response = s.get(surl, headers=headers)
netdiskBonus = response.json()['netdiskBonus']
if (response.json()['isSign'] == "false"):
print(f"未签到,签到获得{netdiskBonus}M空间")
res1 = f"未签到,签到获得{netdiskBonus}M空间"
else:
print(f"已经签到过了,签到获得{netdiskBonus}M空间")
res1 = f"已经签到过了,签到获得{netdiskBonus}M空间"
headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6',
"Referer": "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
"Host": "m.cloud.189.cn",
"Accept-Encoding": "gzip, deflate",
}
response = s.get(url, headers=headers)
if ("errorCode" in response.text):
print(response.text)
res2 = ""
else:
description = response.json()['description']
print(f"抽奖获得{description}")
res2 = f"抽奖获得{description}"
response = s.get(url2, headers=headers)
if ("errorCode" in response.text):
print(response.text)
res3 = ""
else:
description = response.json()['description']
print(f"抽奖获得{description}")
res3 = f"抽奖获得{description}"
response = s.get(url3, headers=headers)
if ("errorCode" in response.text):
print(response.text)
res4 = ""
else:
description = response.json()['description']
print(f"链接3抽奖获得{description}")
res4 = f"链接3抽奖获得{description}"
title = "天翼云签到"
content = f"""
{res1}
{res2}
{res3}
{res4}
"""
notify.send(title, content)
def lambda_handler(event, context): # aws default
main()
def main_handler(event, context): # tencent default
main()
def handler(event, context): # aliyun default
main()
if __name__ == "__main__":
# time.sleep(random.randint(5, 30))
main()
每日签到
每日抽奖
生活频道转盘抽奖
值会员转盘抽奖
每日任务(指的是签到页面中的任务)
浏览文章
收藏文章
点赞文章
评论文章
分享
抽奖
免费抽奖
5 碎银子抽奖
关注用户
关注栏目
关注品牌
限时累计活动
ql repo https://github.com/hex-ci/smzdm_script.git "" "env.js|bot.js|sendNotify.js" "env.js|bot.js|sendNotify.js"
crypto-js
建议使用 Android 手机抓包(iOS 也可以)域名为 user-api.smzdm.com 的任意链接,把所有 Cookie 取出来放到青龙面板的 SMZDM_COOKIE 环境变量中,多用户请添加多个同名环境变量或者用 & 符号分隔。
如果手机实在抓不到,也可以用浏览器的 Cookie,但是强烈建议使用手机端的 Cookie。
抓包教程
以下教程请大家自行尝试,本人没有亲自尝试,如有问题可以进群交流。
https://www.jianshu.com/p/5e5524868442
https://www.zqh.plus/2022/03/19/Android-Capture/
https://jishuin.proginn.com/p/763bfbd5f92e
https://juejin.cn/post/7091524392005566471
https://www.caq98i.top/article/?page=38
环境变量请使用环境变量列表直接添加,不要使用 export xxx=""
这种方式添加环境变量。
SMZDM_COOKIE:
抓包抓到的 Cookie 内容,需要所有 Cookie 内容,多用户可以用 & 分隔,或者使用多个同名环境变量。
SMZDM_SK:
这个值是可选值,会自动计算,如果你一定想用自己的,可以抓取,是从安卓 App 的 https://user-api.smzdm.com/checkin
请求参数中抓包抓到的,多用户可以用 & 分隔,或者使用多个同名环境变量,顺序要保持与 SMZDM_COOKIE 多用户顺序一致。
SMZDM_USER_AGENT_APP:
这个值是可选值,是指 APP 的 User-Agent,从 APP 的 API 请求头中抓包得到,建议抓取 Android 的 User-Agent
,不填使用脚本默认值。
SMZDM_USER_AGENT_WEB:
这个值是可选值,是指 APP 中访问网页的 User-Agent,一般在 APP 内的转盘网页中抓包得到,建议抓取 Android 的 User-Agent,不填使用脚本默认值。
SMZDM_COMMENT:
如果要完成评论文章的任务请设置这个环境变量,环境变量的内容是评论的文案,文案要大于 10 个汉字,建议用比较个性化的文案,脚本发布评论后会删除这条评论,但是为防止删除失败的情况,请尽量用好一点的文案,防止被判定为恶意灌水。
SMZDM_CROWD_SILVER_5:
每日抽奖任务默认只进行免费抽奖,如要进行 5 碎银子的抽奖,请设置这个环境变量的值为 yes
。
SMZDM_CROWD_KEYWORD:
抽奖关键词,执行非免费抽奖时,会优先选择包含此关键词的抽奖,如果未找到包含此关键词的抽奖,则会随机选择一个。
#!/usr/bin/python3
# -- coding: utf-8 --
# const $ = new Env('恩山签到')
import requests,re,os
import notify
#配置恩山的cookie 到配置文件config.sh export enshanck='' 需要推送配置推送加token export plustoken=''
enshanck = os.getenv("enshanck")
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.125 Safari/537.36",
"Cookie": enshanck,
}
session = requests.session()
response = session.get('https://www.right.com.cn/FORUM/home.php?mod=spacecp&ac=credit&showcredit=1', headers=headers)
try:
coin = re.findall("恩山币: (.*?)nb ", response.text)[0]
point = re.findall("积分: (.*?), response.text)[0]
res = f"恩山币:{coin}\n积分:{point}"
print(res)
notify.send("恩山签到", res)
except Exception as e:
res = str(e)
说明:配置恩山的环境变量,enshanck
,把获取到的cookies全部复制。
#!/usr/bin/python3
# -- coding: utf-8 --
# -------------------------------
# @Author : github@wd210010 https://github.com/wd210010/just_for_happy
# @Time : 2023/2/27 13:23
# -------------------------------
# cron "30 7 * * *" script-path=xxx.py,tag=匹配cron用
# const $ = new Env('天气推送')
import requests, json ,os,notify
# 城市code 自己城市的code https://fastly.jsdelivr.net/gh/Oreomeow/checkinpanel@master/city.json 这个网址查看
# city_code = ''
# 青龙变量 city_code
city_code = os.getenv("city_code")
r = requests.get(
f"http://t.weather.itboy.net/api/weather/city/{city_code}"
)
d = json.loads(r.text)
result2 = json.loads(r.text)['cityInfo']
msg = (
f' 城市:{d["cityInfo"]["parent"]} {d["cityInfo"]["city"]}\n'
f' 日期:{d["data"]["forecast"][0]["ymd"]} {d["data"]["forecast"][0]["week"]}\n'
f' 天气:{d["data"]["forecast"][0]["type"]}\n'
f' 温度:{d["data"]["forecast"][0]["high"]} {d["data"]["forecast"][0]["low"]}\n'
f' 湿度:{d["data"]["shidu"]}\n'
f' 空气质量:{d["data"]["quality"]}\n'
f' PM2.5:{d["data"]["pm25"]}\n'
f' PM10:{d["data"]["pm10"]}\n'
f' 风力风向 {d["data"]["forecast"][0]["fx"]} {d["data"]["forecast"][0]["fl"]}\n'
f' 感冒指数:{d["data"]["ganmao"]}\n'
f' 温馨提示:{d["data"]["forecast"][0]["notice"]}\n'
f' 更新时间:{d["time"]}'
)
w_list = []
for i in range(7):
list = [
d['data']['forecast'][i]['ymd'],
d['data']['forecast'][i]['week'],
d['data']['forecast'][i]['type'],
d['data']['forecast'][i]['low'],
d['data']['forecast'][i]['high'],
d['data']['forecast'][i]['notice']
]
w_list.append(list)
seven_days_weather = str(w_list).replace('], [','\n').replace(', ','').replace('[','').replace(']','').replace('\'',' ')
msg_total = (msg + '\n\n'+ seven_days_weather)
print(msg_total)
notify.send("保定天气", msg_total)
说明需要配置环境变量cityInfo
,查看自己城市代码地址
# @author Sten
# 作者仓库:https://github.com/aefa6/QinglongScript.git
# 觉得不错麻烦点个star谢谢
import requests
import json
import notify
title = "下个节假日"
dateurl = 'https://date.appworlds.cn/next'
date1url = 'https://date.appworlds.cn/next/days'
holiday = requests.get(dateurl)
holiday1 = requests.get(date1url)
desc = json.loads(holiday.text)
desc1 = json.loads(holiday1.text)
daytime = desc['data']['date']
dayname = desc['data']['name']
Remain = desc1['data']
info = f"""
下个节假日是{Remain}天后的{dayname}({daytime})
"""
print(info)
notify.send(title, info)
# @author Sten
# 作者仓库:https://github.com/aefa6/QinglongScript.git
# 觉得不错麻烦点个star谢谢
# 使用青龙自带的通知
import requests
import json
import notify
url = 'https://60s.viki.moe/?encoding=text'
resp = requests.get(url)
# 分片处理
pieces = resp.text.split('\n', 8)
content1 = '\n'.join(pieces[:8])
content2 = '\n'.join(pieces[8:])
info1 = f"""
{content1}
"""
info2 = f"""
{content2}
"""
# 发送分片推送
notify.send("每天60s读懂世界", info1 + "\n\n")
notify.send("每天60s读懂世界", info2)
github地址
截止到2023.11.12,问题出现:人机校验失败
问题等待大佬解决中。。。
2023.11.14问题解决,这就是效率!!!
打开requirement.txt
文件,按照里面的需求安装对应的依赖
。
requests>=2.25.1
python-dotenv>=0.19.2
PyYAML>=6.0
onepush
文件只需要utils包、config.yml、miuitask.py
下载
查看代码默认的推行方式好像是onepush,如果想更改为pushplus,进行如下的代码修改:
- 复制一个
notify.py
文件到最外面文件,即跟utils在同一个包下。【这个只要用来消息提醒的】import notify
在untils.py
中引入- 代码修改:
去掉x
部分,然后添加代码notify.send(“标题”,content)
暂时只找到epic的每周消息提醒,没找到自动签到领取,需要手动进行领取。
github地址
只需要下载mian.py
即可
import json
import requests
from datetime import datetime
def get_free_games() -> dict:
timestamp = datetime.timestamp(datetime.now())
games = {'timestamp': timestamp, 'free_now': [], 'free_next': []}
base_store_url = 'https://store.epicgames.com'
api_url = 'https://store-site-backend-static.ak.epicgames.com/freeGamesPromotions?country=CN'
resp = requests.get(api_url)
for element in resp.json()['data']['Catalog']['searchStore']['elements']:
if promotions := element['promotions']:
game = {}
game['title'] = element['title']
game['images'] = element['keyImages']
game['origin_price'] = element['price']['totalPrice']['fmtPrice']['originalPrice']
game['discount_price'] = element['price']['totalPrice']['fmtPrice']['discountPrice']
game['store_url'] = f"{base_store_url}/p/{element['catalogNs']['mappings'][0]['pageSlug']}" if element['catalogNs']['mappings'] else base_store_url
if offers := promotions['promotionalOffers']:
game['start_date'] = offers[0]['promotionalOffers'][0]['startDate']
game['end_date'] = offers[0]['promotionalOffers'][0]['endDate']
games['free_now'].append(game)
if offers := promotions['upcomingPromotionalOffers']:
game['start_date'] = offers[0]['promotionalOffers'][0]['startDate']
game['end_date'] = offers[0]['promotionalOffers'][0]['endDate']
games['free_next'].append(game)
return games
def generate_json(games: dict, filename: str):
with open(filename, 'w') as f:
json.dump(games, f)
# json.dump(obj=games, fp=f, ensure_ascii=False, indent=4)
def generate_markdown(games: dict, filename: str):
images = {}
data = games['free_now'] + games['free_next']
for game in data:
for image in game['images']:
if image['type'] in ['OfferImageWide', 'VaultClosed']:
images[game['title']] = image['url']
break
content = '''# Epic 每周限免
- ## 本周限免
'''
for game in games['free_now']:
content += f'''
- ### [{game['title']}]({game['store_url']} "{game['title']}")
原价: {game['origin_price']}
购买链接: [{game['store_url']}]({game['store_url']} "{game['title']}")
![{game['title']}]({images[game['title']]})
'''
content += f'''
- ## 下周限免
'''
for game in games['free_next']:
content += f'''
- ### [{game['title']}]({game['store_url']} "{game['title']}")
原价: {game['origin_price']}
购买链接: [{game['store_url']}]({game['store_url']} "{game['title']}")
![{game['title']}]({images[game['title']]})
'''
with open(filename, 'w') as f:
f.write(content)
if __name__ == '__main__':
games = get_free_games()
generate_json(games, './epic_free_games.json')
generate_markdown(games, './README.md')
代码优化:
import notify
引入到main.py中【消息提醒】- 修改代码:最后加上
file = open(‘help.md’,‘r’,encoding=‘utf-8’).read()
html = markdown(file)
notify.send(“标题”,html)
效果图: