2025年11月5日星期三

回收猿回收任务脚本

1.购买服务器阿里云:服务器购买地址https://t.aliyun.com/U/Bg6shY若失效,可用地址

1.购买服务器

阿里云:

服务器购买地址

https://t.aliyun.com/U/Bg6shY

若失效,可用地址

https://www.aliyun.com/daily-act/ecs/activity_selection?source=5176.29345612&userCode=49hts92d

腾讯云:

https://curl.qcloud.com/wJpWmSfU

若失效,可用地址

https://cloud.tencent.com/act/cps/redirect?redirect=2446&cps_key=ad201ee2ef3b771157f72ee5464b1fea&from=console

华为云

https://activity.huaweicloud.com/cps.html?fromacct=64b5cf7cc11b4840bb4ed2ea0b2f4468&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905

2.部署教程

2024年最新青龙面板跑脚本教程(一)持续更新中

3.代码如下

# cron: 16 8 * * *import requestsimport json,os,sys,reimport hashlib,timefrom notify import send
# md5 = "action=user&appkey=1079fb245839e765&merchant_id=2&method=center&username={wx_username}UppwYkfBlk"# md5_hash = hashlib.md5(md5.encode('utf-8')).hexdigest().upper().lower()# print(md5_hash) # sign为固定值 def pr(message):    msg.append(message + "\n" )    print(message)
msg = []def index(wx_auth,wx_username): #登录信息   url = f"https://www.52bjy.com/api/app/user.php?action=userinfo&app=hsywx&appkey=1079fb245839e765&auth={wx_auth}&merchant_id=2&username={wx_username}"   header = {        "authority""www.52bjy.com",        "method""GET",        "path""/api/app/user.php?action=userinfo&app=hsywx&appkey=1079fb245839e765&auth={wx_auth}&merchant_id=2&username={wx_username}",        "scheme""https",        "user-agent""Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/8555",        "content-type""application/json",        "referer""https://servicewechat.com/wxadd84841bd31a665/91/page-frame.html"        }   response = requests.get(url=url,headers=header)   time.sleep(3)   response.encoding = "utf-8"   info = json.loads(response.text)   if info['isSucess']:       pr(f"登陆成功,用户名:{info['data']['nickname']}")       md5 = f"action=user&app=hsywx&appkey=1079fb245839e765&merchant_id=2&method=qiandao&username={wx_username}&version=2UppwYkfBlk"       wx_sign = hashlib.md5(md5.encode('utf-8')).hexdigest().upper().lower()       qiandao(wx_username,wx_sign)   else:       pr(info['message'])    
def qiandao(wx_username,wx_sign): #签到    url = f"https://www.52bjy.com/api/app/hsy.php?action=user&app=hsywx&appkey=1079fb245839e765&merchant_id=2&method=qiandao&username={wx_username}&version=2&sign={wx_sign}"    header = {            "authority""www.52bjy.com",            "method""POST",            "path"f"/api/app/hsy.php?action=user&app=hsywx&appkey=1079fb245839e765&merchant_id=2&method=qiandao&username={wx_username}&version=2",            "scheme""https",            "envconnection""test",            "user-agent""Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090c11)XWEB/11437",            "content-type""application/json",            "referer""https://servicewechat.com/wxadd84841bd31a665/91/page-frame.html",            }    response = requests.post(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    md5 = f"action=user&appkey=1079fb245839e765&merchant_id=2&method=center&username={wx_username}UppwYkfBlk"    wx_sign_info = hashlib.md5(md5.encode('utf-8')).hexdigest().upper().lower()    if info['isSucess']:       pr(info['message'])       pr(f"签到红包:{info['data']['qiandao_award']}元,签到天数:{info['data']['double_award_days']}")       signinfo(wx_username,wx_sign_info)    else:       pr(info['message'])        signinfo(wx_username,wx_sign_info)def signinfo(wx_username,wx_sign_info): #红包    url = f"https://www.52bjy.com/api/app/hsy.php?action=user&appkey=1079fb245839e765&merchant_id=2&method=center&username={wx_username}&sign={wx_sign_info}"    header = {        "authority""www.52bjy.com",        "method""GET",        "path"f"/api/app/hsy.php?action=user&appkey=1079fb245839e765&merchant_id=2&method=center&username={wx_username}&sign={wx_sign_info}",        "scheme""https",        "user-agent""Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/8555",        "content-type""application/json",        "referer""https://servicewechat.com/wxadd84841bd31a665/91/page-frame.html"        }    response = requests.get(url=url,headers=header)    time.sleep(3)    response.encoding = "utf-8"    info = json.loads(response.text)    if info['isSucess']:       pr(f"红包总额:{info['data']['yuanbao']}元"    else:        pr(info)  

def sicxs():    config_path = 'config.py'    if os.path.exists(config_path):      import config      else:      with open(config_path, 'w'as f:         pr("首次运行,已创建配置文件 config.py,请按照说明填写相关变量后再次运行脚本。")        f.write('#可以在此文件中添加配置变量,例如:\nsfsy = ""\n')    try:        env_cookie = os.environ.get("wx_hsyhs")        si_cookie = getattr(config, 'wx_hsyhs'''        if env_cookie and si_cookie:            cookies = env_cookie + "\n" + si_cookie        elif env_cookie:            cookies = env_cookie        elif si_cookie:            cookies = si_cookie        else:            pr("请设置变量 export wx_hsyhs='' 或在 config.py 中设置 wx_hsyhs =")            sys.exit()    except Exception as e:        pr("请设置变量 export wx_hsyhs='' 或在 config.py 中设置 wx_hsyhs =")        sys.exit()
    list_cookie = [c for c in re.split(r'\n|&', cookies) if c.strip()]    total_cookies = len(list_cookie)
    for i, list_cookie_i in enumerate(list_cookie):        try:            print(f'\n----------- 账号【{i + 1}/{total_cookies}】执行 -----------')            pr(f"账号【{i + 1}】开始执行:")            list = list_cookie_i.split("#")            index(list[0], list[1])        except Exception as e:            pr(f"账号【{i + 1}/{total_cookies}】执行出错: {e}")            finally:            send("回收猿回收"''.join(msg))            msg.clear()     print(f'\n-----------  执 行  结 束 -----------')

if __name__ == '__main__':      sicxs()      
解析

该脚本为回收猿回收自动签到脚本。

主要作用

  • 回收猿回收(微信小程序)自动签到脚本:基于抓包得到的 auth 与 username,按固定规则本地计算 sign,完成登录校验 → 签到 → 账户红包信息查询的一次性闭环。

  • 多账号与通知:从环境变量或 config.py 读取多账号(auth#username用**换行或 &**分隔),逐个执行并用 notify.send("回收猿回收", …) 推送汇总,适合 cron 定时(示例:16 8 * * *)。

主要方法

  • pr(message): 统一日志与汇总,写入全局 msg,便于末尾一次性通知。

  • index(wx_auth, wx_username):

    1. 访问 用户信息接口 校验 auth/username 是否有效;

    2. 登录成功后按约定拼接字符串并 MD5 计算签到用 sign

    3. 进入 qiandao() 执行签到。

  • qiandao(wx_username, wx_sign):
    调用 签到接口;成功时打印"签到红包、签到天数"等,并继续查询账户中心;失败也会继续查询,确保能拿到账户概览。

  • signinfo(wx_username, wx_sign_info):
    调用 用户中心接口,输出"红包总额(yuanbao)"等核心余额信息。

  • sicxs():

    • 初始化/创建 config.py

    • 合并读取变量 wx_hsyhs(环境变量与 config.py 同名变量),按**换行或 &**切分;每个账号内容为 auth#username

    • 逐个账号执行 index();每个账号结束后发送一次通知并清空 msg;最后打印"执行结束"。

要点

  • sign 由固定模板字符串 + MD5 生成(区分签到与中心查询两种模板);若官方接口或拼接顺序变更,需同步更新。

  • UA/Referer 保持小程序环境指纹更稳妥;异常时可适当增加 sleep 与重试。

  • 确保 auth 未过期;如频繁失败,优先重新抓取"我的"页里的 auth/username

  • 多账号格式:一行一个 auth#username;示例(环境变量)
    export wx_hsyhs='authA#userA\nauthB#userB' 或 authA#userA&authB#userB


注意

本文部分变量已做脱敏处理,仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断。技术层面需要提供帮助,可以通过打赏的方式进行探讨。


历史脚本txt文件获取>>
服务器搭建,人工服务咨询>>

没有评论:

发表评论

全球主机论坛任务脚本

1.购买服务器阿里云:服务器购买地址https://t.aliyun.com/U/Bg6shY若失效,可用地址 1.购买服务器 阿里云: 服务器购买地址 https : //t.aliyun.com/U/Bg6shY 若失效,可用地址 https ://www.aliyun....