乐云主机笔记

  • 首页
  • 主机优惠
  • 学习记录
  • 新手教程
  • 自用主机
  • 资源下载
  • 网赚项目
  • 其他
  • pingtest

  1. 首页
  2. 新手教程
  3. 正文

又一款LOC专用刷分代码

2019年1月21日 960点热度 0人点赞 0条评论

一、使用方法:

建立你需要的路径下建立LOC.php,贴入下方面代码,完善16、18处用户名和密码保存,定期访问网址或加入服务器自动任务

images

二、代码

#-*- coding=utf-8 -*-
import requests
import re
import sys
import urllib3
import time

urllib3.disable_warnings()

index='https://www.hostloc.com/'
page_url='https://www.hostloc.com/forum-45-1.html'
credit_url='https://www.hostloc.com/home.php?mod=spacecp&ac=credit&showcredit=1'
login_url='https://www.hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1'
login_data={
        'fastloginfield':'username'
        ,'username':''
        ,'cookietime':'2592000'
        ,'password':''
        ,'quickforward':'yes'
        ,'handlekey':'ls'
    }
headers={
    'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
    ,'Accept-Encoding':'gzip, deflate, sdch'
    ,'Accept-Language':'zh-CN,zh;q=0.8,en;q=0.6'
    ,'Host':'www.hostloc.com'
    ,'Referer':'https://www.hostloc.com/forum.php'
    ,'Upgrade-Insecure-Requests':'1'
    ,'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'
}


class HostLoc():
    def __init__(self,username,passwd):
        self.username=username
        self.passwd=passwd
        self.session=requests.Session()
        self.session.headers=headers
        login_data['username']=username
        login_data['password']=passwd
        login_data['formhash']=self.get_hidden_value(index,'formhash')
        self.login()


    def login(self):
        self.session.post(login_url,data=login_data,verify=False)

    def isLogin(self):
        url='https://www.hostloc.com/home.php?mod=spacecp'
        html=self.session.get(url).text
        UserName=re.findall(self.username,html)
        if len(UserName)==0:
            return False
        else:
            return True

    def get_credit(self):
        html=self.session.get(credit_url,verify=False).text
        credit_pattern=re.compile(u'</ul><ul class="creditl mtm bbda cl"><li class="xi1 cl"><em> 金钱: </em>(.*?)  .*? </li>[\w\W]*?<li><em> 威望: </em>(.*?) </li>[\w\W]*?<li class="cl"><em>积分: </em>(.*?) <span class="xg1">')
        try:
            credit=credit_pattern.findall(html)
            coin,wh,jf=credit[0]
            print(u"{} coin:{},wei wang:{},jifen:{}".format(self.username,coin,wh,jf))
            return True
        except Exception as e:
            print(u"{} fetch data error!:{}".format(self.username,e))
            return False

    def get_user(self):
        print('parse '+page_url)
        self.html=self.session.get(page_url,verify=False).text
        user_pattern=re.compile('space-uid-\d+?.html')
        users=list(set(user_pattern.findall(self.html)))
        self.users=[index+i for i in users]

    def visit_user(self):
        for user in self.users[:10]:
            print('visit user '+user)
            self.session.get(user)

    def get_hidden_value(self,url,keyname):
        r=self.session.get(url)
        cont=r.text
        value=re.findall('<input type="hidden" name="{}" value="(.*?)" />'.format(keyname),cont)[0]
        return value


def start():
    #多用户配置
    #格式为:[[username1,password1],[username2,password2],[username3,password3]]
    users=[
        ['user1','password1'],
        ['user2','password2'],
    ]
    for username,passwd in users:
        hostloc=HostLoc(username,passwd)
        if hostloc.get_credit():
            hostloc.get_user()
            hostloc.visit_user()
            hostloc.get_credit()


def main_handler(event, context):
    return start()

if __name__=='__main__':
    start()

标签: 暂无
最后更新:2019年1月22日

letvps

这个人很懒,什么都没留下

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

分类
  • 主机优惠
  • 其他
  • 域名优惠
  • 学习记录
  • 新手教程
  • 网赚项目
  • 脚本源码
  • 自用主机
  • 资源下载
书签
  • AdvinServers.com
  • 猫云云计算

COPYRIGHT © 2021 Letcloud.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

粤ICP备15031609号-3