2025年11月7日星期五

精益论坛任务脚本

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: 20 8 * * *import requestsimport re,timeimport os,sys,jsonfrom notify import send
def pr(message):    msg.append(message + "\n" )    print(message)
msg = []def index(cookie): #登录    url = "https://bbs.ijingyi.com/plugin.php"
    params = {    'id'"dsu_paulsign:sign"    }
    headers = {    'User-Agent'"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0",    '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",    'cache-control'"max-age=0",    'sec-ch-ua'"\"Microsoft Edge\";v=\"141\", \"Not?A_Brand\";v=\"8\", \"Chromium\";v=\"141\"",    'sec-ch-ua-mobile'"?0",    'sec-ch-ua-platform'"\"Windows\"",    'upgrade-insecure-requests'"1",    'sec-fetch-site'"none",    'sec-fetch-mode'"navigate",    'sec-fetch-user'"?1",    'sec-fetch-dest'"document",    'accept-language'"zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",    'priority'"u=0, i",    'Cookie': cookie,    }
    response = requests.get(url=url,headers=headers,params=params)    response.encoding = "utf-8"    info = response.text    if "<em>登录</em></button></td>" in info:        pr("cookie失效或错误")    else:        pr("账号登陆成功")          time.sleep(3)        if "您今日已经签到" in info:            url = "https://bbs.ijingyi.com/plugin.php"            response = requests.get(url=url,headers=headers)            response.encoding = "utf-8"            info = response.text            pattern = re.compile(r'uid=(.*?)" target="_blank" title="访问我的空间">(.*?)</a>')            matches = pattern.findall(info)             if not matches :               pr("解析用户信息失败,可能页面结构变化或 cookie 无效")               return            id = matches[0][0]            pr("今日已完成签到,无需重复签到")            infoo(id,headers)            return        pattern = re.compile(r'uid=(.*?)" target="_blank" title="访问我的空间">(.*?)</a>')        pattern1 = re.compile(r'formhash=(.*?)">退出</a>')        matches = pattern.findall(info)         matches1 = pattern1.findall(info)        if not matches or not matches1 :          pr("解析用户信息失败,可能页面结构变化或 cookie 无效")          return        pr(f"用户名: {matches[0][1]}")        hash = matches1[0]        id = matches[0][0]        qiandao(hash, headers)        time.sleep(3)        infoo(id,headers)
def infoo(id,headers):#我的信息    url = f"https://bbs.ijingyi.com/home.php?mod=space&uid={id}&do=profile&from=space"    response = requests.get(url=url,headers=headers)    response.encoding = "utf-8"    info = response.text    pattern = re.compile(r'<li><em>积分</em>(.*?)</li>')    pattern1 = re.compile(r'<li><em>精币</em>(.*?)</li>')    pattern2 = re.compile(r'<li><em>荣誉</em>(.*?)</li>')    pattern3 = re.compile(r'<h2>该会员签到详情</h2><p>累计签到总天数 : <b>(.*?)</b> 天</p><p>连续签到天数 : <b>(.*?)</b> 天</p><p>本月签到天数 : <b>(.*?)</b> 天')    matches = pattern.findall(info)     matches1 = pattern1.findall(info)     matches2 = pattern2.findall(info)     matches3 = pattern3.findall(info)     if not matches or not matches1 or not matches2 or not matches3:          pr("解析用户信息失败,可能页面结构变化或 cookie 无效")          return    pr(f"积分: {matches[0]} 精币: {matches1[0]} 荣誉: {matches2[0]} 签到累计天数: {matches3[0][0]} 本月签到天数: {matches3[0][2]} 连续签到天数: {matches3[0][1]} ")
def qiandao(hash, headers):    url = "https://bbs.ijingyi.com/plugin.php?id=dsu_paulsign:sign&operation=qiandao&infloat=1"    data = {        'formhash'hash,        "submit""1",        "targerurl""",        "todaysay""",        "qdxq""kx"    }
    try:        response = requests.post(url=url, headers=headers, data=data)        response.encoding = "utf-8"        info = json.loads(response.text)
        if info['status'] == 1:            pr(f"签到成功,连续签到 {info['data']['mdays']} 天")        else:            pr(f"签到失败: {info}")      except Exception as e:        pr(f"签到过程中发生未知错误: {str(e)}")   
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("wy_jylt")        si_cookie = getattr(config, 'wy_jylt'''        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 wy_jylt='' 或在 config.py 中设置 wy_jylt")            sys.exit()    except Exception as e:        pr("请设置变量 export wy_jylt='' 或在 config.py 中设置 wy_jylt")        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):        print(f'\n----------- 账号【{i + 1}/{total_cookies}】执行 -----------')        pr(f"账号【{i + 1}】开始执行:")        try:            index(list_cookie_i)        except Exception as e:            pr(f"执行账号【{i + 1}】时发生错误: {e}")        finally:          send("精益论坛"''.join(msg))          msg.clear()    print(f'\n-----------  执 行  结 束 -----------')

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

该脚本为精益论坛自动签到脚本。

主要作用

  • 精益论坛自动签到脚本:使用已登录的 Cookie 访问 dsu_paulsign:sign 插件页,自动识别是否已签到;未签到则提交签到表单,随后抓取个人资料页汇总积分、金币、荣誉、累计/本月/连续签到天数等信息。

  • 多账号与通知:从环境变量或 config.py 读取 wy_jylt(多账号用换行或 & 分割),逐个执行;每个账号执行完成后通过 notify.send("精益论坛", …) 推送结果;适合 cron 定时(示例:20 8 * * *)。

主要方法

  • pr(message):统一日志收集到全局 msg,便于单账号结束一次推送、多账号循环时清空重用。

  • index(cookie)(登录/入口):

    1. 以 Cookie 访问签到插件页面,判断cookie 是否有效今日是否已签

    2. 若已签到,转到主页再次获取用户 uid,直接调用 infoo 拉取资料;

    3. 若未签到,从页面提取 formhash 与 uid/用户名,先 qiandao(formhash, headers),再调用 infoo

  • qiandao(hash, headers)(执行签到):向签到接口提交 formhash + qdxq(心情:kx);解析 JSON 返回,输出是否成功与连续签到天数

  • infoo(id, headers)(资料汇总):进入个人资料页,正则提取积分、金币、荣誉、累计/本月/连续天数并打印汇总。

  • sicxs()(配置与多账号调度):

    • 首次运行自动生成 config.py 提示;

    • 合并环境变量与 config.py 的 wy_jylt 值,按换行或 & 切分多账号;

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

使用与注意

  • 必备:抓取并长期有效的论坛 Cookie;一旦 <em>登录</em> 出现说明失效,需要重新获取。

  • 风控:同 IP 多号或异常频率可能触发验证;可在计划任务中错峰或增加随机等待。

  • 鲁棒性:若页面结构/正则字段变动(如 formhash、积分栏位),会出现"解析失败"提示;需更新对应选择器/正则。

  • 多账号格式export wy_jylt='cookieA\ncookieB' 或 cookieA&cookieB

  • 依赖requestsnotify;网络异常未加重试策略,可视需要加超时与重试。


注意

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


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

没有评论:

发表评论

从0到$30K月利润:Pushcroll如何用「病毒式内容 + 自动化私域」实现爆发式增长

增长其实不是技巧,而是好奇心。\x0d\x0a你要不断问——为什么这条视频能火?为什么那条不能?\x0d\x0a当你能回答这个问题,你的增长就开始了。" 在短短几个月内,一款名为  Pushcroll  的应用靠一条"做俯卧撑才能刷短视频"的创意...