#脚本# Python3论坛自动签到刷分脚本,支持多马甲
主机社 1月前

适用于多马甲

登陆,并看十个人的空间
Python3 ,模块应该自带了。
——-
在 account_dict 按格式写账号密码,就应该没问题了.
用户名是支持中文的,测试过了.
——-
不优雅,练手,勿喷

#!/usr/bin/env python# -*- coding: UTF-8 -*-from urllib import requestfrom http import cookiejaraccount_dict = {    '0': {'username': 'xxxx', 'password': 'xxx'},    '1': {'username': 'yyyy', 'password': 'xxx'},    '2': {'username': 'zzzz', 'password': 'xxx'},}def Login(URL, UserData):    __cookies = ''    __cookie = cookiejar.CookieJar()    __handler = request.HTTPCookieProcessor(__cookie)    __req = request.Request(URL, data=str(UserData).encode('utf-8'))    request.build_opener(__handler).open(__req)    for cookie in __cookie:        __cookies += cookie.name + '=' + cookie.value + ';'    return __cookiesdef GetPage(URL, Header_Cookies):    __Header = {'Cookie': str(Header_Cookies)}    __req = request.Request(URL, headers=__Header)    return request.urlopen(__req).read().decode('utf-8')def GetCredit(username, password):    Login_URL = 'https://www.hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1'    My_Home = 'https://www.hostloc.com/home.php?mod=spacecp&inajax=1'    user_data = 'username=' + str(username) + '&' + 'password=' + str(password)    My_Cookies = Login(Login_URL, user_data)    if '<td>' + str(username) + '</td>' not in GetPage(My_Home, My_Cookies):        isLogin = False        print('[%s] Login Fail!' % username)    else:        isLogin = True        print('[%s] Login Success!' % username)    if isLogin:        for __x in range(25297, 25309):            __url = 'https://www.hostloc.com/space-uid-{}.html'.format(__x)            GetPage(__url, My_Cookies)if __name__ == '__main__':    for __i in range(0, len(account_dict)):        GetCredit(account_dict[str(__i)]['username'], account_dict[str(__i)]['password'])

作者:Vicer     

支持作者:MoeClub.org

原帖查看[Python 练手] 看到有需要论坛自动签到脚本,支持多马甲,勿喷

最新回复 (0)
返回
网站标签