吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 6463|回复: 12
收起左侧

[Python 原创] 【原创源码】 【无需第三方库】【支持签到 】 Python 吾爱挂机 无提示版

[复制链接]
Dlan 发表于 2015-11-22 13:56
本帖最后由 Dlan 于 2016-1-18 12:00 编辑

2016年1月18日 更新,添加了网络异常的判断

使用教程:
1.安装python http://jingyan.baidu.com/article/7908e85c78c743af491ad261.html

2.获取你的cookies:
2222.gif
获取后写入文件的your cookie 位置 注意 不要覆盖了引号

3.挂机:
         centos: yum install screen
         ubuntu: apt-get install screen
         screen使用教程:http://www.cnblogs.com/mchina/archive/2013/01/30/2880680.html
源码:
[Python] 纯文本查看 复制代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import urllib2
import sys
import re
class WAPJ():
    def __init__(self,cookies):
        self.cookies = cookies
        self.sign = 'http://www.52pojie.cn/home.php?mod=task&do=apply&id=2'
        self.info1 = 'http://www.52pojie.cn/home.php?mod=spacecp&ac=usergroup&showextgroups=0&inajax=2&ajaxtarget=g_upmine_menu'
        self.info2 = 'http://www.52pojie.cn/home.php?mod=spacecp&ac=credit&showcredit=0&inajax=1&ajaxtarget=extcreditmenu_menu'
       # self.space = "http://www.52pojie.cn/home.php?mod=space&uid=159808&do=profile&from=space"
        self.headers = {'user-agent':'Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0',
                        'Cookie': self.cookies
                        }

    def signAndOnLine(self):
        try:
            req =  urllib2.Request(self.sign,headers=self.headers)
            req2 =  urllib2.Request(self.space,headers=self.headers)
            res = urllib2.urlopen(req,timeout=4)
            res2 = urllib2.urlopen(req2,timeout=4)
            page = res.read()
            page2 =  res2.read()
        except Exception, e :
            print e
            print '[-]Network anomaly '
            return False
        if 'LCG_Register' in page: #没有登陆成功
            print '[-]Cookies is error! \n[-]Loging fail!'
            sys.exit()
        if 'task&item=new'in page:
            print 'Refresh success!'
        
        #m = re.search('</em>(.*?)</li><li><em>', page2)
       # if m:
           # print m.group(1)

        return True
    def getInfo(self):
        pass
    def run(self):
        if  self.signAndOnLine():
            print '10 minutes to refresh'
        while True:
            self.signAndOnLine()
            time.sleep(300)

if __name__ == '__main__':
    wapj = WAPJ("")
        wapj.run()    

运行图例:
111.gif




免费评分

参与人数 1热心值 +1 收起 理由
1.shui + 1 哈喽,能来个视屏吗?

查看全部评分

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

moker 发表于 2016-12-7 16:01
本帖最后由 moker 于 2016-12-7 21:24 编辑

C:\Anaconda3\python.exe E:/python/52
Traceback (most recent call last):
  File "E:/python/52", line 54, in <module>
    wapj.run()
  File "E:/python/52", line 46, in run
    if self.signAndOnLine():
  File "E:/python/52", line 32, in signAndOnLine
    if 'LCG_Register' in page:  # 没有登陆成功
TypeError: a bytes-like object is required, not 'str'

Process finished with exit code 1


放到3.5里面,怎么会了会出现这个错误,求楼主指点
 楼主| Dlan 发表于 2016-12-8 10:25
moker 发表于 2016-12-7 16:01
C:\Anaconda3\python.exe E:/python/52
Traceback (most recent call last):
  File "E:/python/52", lin ...

不支持python 3 请用2.7 并且脚本可能过时了
Myself_GF 发表于 2015-11-22 14:13
1.shui 发表于 2015-11-22 14:56
谢谢分享,好难懂呀~~~
woshiwuok 发表于 2015-11-22 15:10
真心看不懂
Cizel 发表于 2015-11-22 18:06
蛮喜欢的,挂到服务器去
 楼主| Dlan 发表于 2015-11-22 19:16
奋斗丶小Z 发表于 2015-11-22 18:06
蛮喜欢的,挂到服务器去

挂了么有呢               
Cizel 发表于 2015-11-23 18:16

之前挂的是另外一个,现在失效了~
Cizel 发表于 2015-11-23 18:16

之前挂的是另外一个,现在失效了~
kujie0121 发表于 2015-11-27 09:56
  挂哪里的? 论坛账号么?
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

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

GMT+8, 2024-3-29 02:15

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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