吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 7434|回复: 52
收起左侧

[Python 原创] 精易论坛自动签到脚本,可挂青龙

  [复制链接]
wqs12345 发表于 2022-12-12 12:02
本帖最后由 wqs12345 于 2022-12-12 18:29 编辑

参考了论坛内其他人作品,自己再修改了一下。可以实效自动签到,自动评分帖子.修改一个bug。大家重新下吧。已签到和签到成功,返回不一样。没注意处理
002.png 004.png

[Python] 纯文本查看 复制代码
import requests
import random
import re
import time
from lxml import etree
def dailyTask():
    headers = {
        'cookie': '你的COOKIE',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36 Edg/96.0.1054.62'
    }
    # for i in range(5):
    session = requests.session()
    pageNumber = random.randint(0, 5)
    url_page = 'https://bbs.125.la/plugin.php?id=dsu_paulsign:sign'
    rep = session.get(url=url_page, headers=headers)
    temp=re.findall(r'/thread-14(.*).html" target="_blank"', rep.text)
    formhash=re.findall(r'formhash=(.*)">退出', rep.text)
    #print(formhash)
    url_page ='https://bbs.125.la/plugin.php?id=dsu_paulsign:sign&operation=qiandao&infloat=1'
    rep = session.post(url=url_page, headers=headers,data = {'formhash':formhash,"submit": "1","targerurl": "","todaysay": "","qdxq": "kx"})
    print(rep.text)
    for i in range(0,len(temp)):
        url_page = 'https://bbs.125.la/thread-14'+temp[i]+'.html'
        rep = session.get(url=url_page, headers=headers)
        if rep.status_code == 200:
            #print('进入帖子详情页成功')
            tree = etree.HTML(rep.text)
            a_list = tree.xpath('//*[@id="ak_rate"]/@onclick')
            addr = a_list[0]
            str1 = addr.split(',')
            str2 = str1[1].split('&')
            tid1 = str2[2]
            pid1 = str2[3]
            tid2 = tid1.split('=')[1]
            pid2 = pid1.split('=')[1]
            pid3 = pid2.split('\'')[0]
            tid = tid2
            pid = pid3  # 获取到tid与pid
            formash1 = tree.xpath('//*[@id="vfastpost"]/input/@value')
            formash = formash1[0]  # 获取到formash
            #print("获取pid={}与tid={}与formash={}成功,开始自动评分".format(pid, tid, formash))
            # 开始评分
            url_score = 'https://bbs.125.la/forum.php?mod=misc&action=rate&ratesubmit=yes&infloat=yes&inajax=1'
            data = 'formhash=' + formash + '&tid=' + tid + '&pid=' + pid + '&referer=https%3A%2F%2Fbbs.125.la%2Fforum.php%3Fmod%3Dviewthread%26tid%3D' + tid + '%26page%3D0%23pid' + pid + '&handlekey=rate&score4=%2B1&reason=%E6%84%9F%E8%B0%A2%E5%88%86%E4%BA%AB%EF%BC%8C%E5%BE%88%E7%BB%99%E5%8A%9B%EF%BC%81%7E'
            headers['Content-Type'] = 'application/x-www-form-urlencoded'
            headers['Referer'] = 'https://bbs.125.la/thread-14720892-1-1.html'
            rep_score = session.post(url=url_score, data=data,headers=headers)
            #print(1)
            #print(rep_score.status_code)
            #print(rep_score.text)
            print("评分结果:"+re.findall(r'CDATA\[(.*)<scrip', rep_score.text)[0])
            time.sleep(1)
            x = rep_score.text.find("超过限制")
            if x!=-1:
                break;


        else:
            print('进入帖子失败')


if __name__ == '__main__':
    dailyTask()
003.png

免费评分

参与人数 9吾爱币 +13 热心值 +9 收起 理由
尔东 + 1 + 1 热心回复!
52pure + 1 + 1 我很赞同!
korys878 + 1 + 1 热心回复!
貂蝉赶紧出肉 + 1 + 1 我很赞同!
苏紫方璇 + 5 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
GT000814 + 1 + 1 我很赞同!
woyucheng + 1 + 1 谢谢@Thanks!
xingkongyongye + 1 + 1 谢谢@Thanks!
xlln + 1 + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| wqs12345 发表于 2022-12-12 15:14
aibaisong 发表于 2022-12-12 14:30
cookie啥格式地,没分清哪个

lDlk_ecc9_connect_is_bind=0; lDlk_ecc9_nofavfid=1; lDlk_ecc9_smile=4D1; Hm_lvt_c6927066ad2f2806b262f20b26fabff4=1640921266; lDlk_ecc9_saltkey=ZWyWb9p8; lDlk_ecc9_lastvisit=1644818076; lDlk_ecc9_auth=09a60ywzuiQo%....................
ppgjx 发表于 2022-12-12 13:44
yun520530 发表于 2022-12-12 14:09
JunnyHAHA 发表于 2022-12-12 12:08
我想挂到青龙上面跑
空竹 发表于 2022-12-12 12:14
青龙是啥
Exia2021 发表于 2022-12-12 12:19

是个好东西   我拿跑JD
akillking 发表于 2022-12-12 12:30
支持原创,感谢分享
zg2600 发表于 2022-12-12 13:11
cookie有效期是多长时间
wglwh 发表于 2022-12-12 13:33
项目地址在哪?
路人王2021 发表于 2022-12-12 13:34
what is 青龙 means ?
xingkongyongye 发表于 2022-12-12 13:38
感谢楼主的分享
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-24 15:55

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表