小米社区多账号自动签到养号。

小米社区多账号自动签到养号。

最近澎湃OS热火朝天,解BL锁需要小米社区5及以上,所以不得不想想办法刷一刷小米社区的等级,这里同样是用得青龙面板每天定时执行,原脚本是单账号,这里动手改了多账号。 代码如下: import requests,json,time,base64,binascii,hashlib,datetime,sys clas...

最近澎湃OS热火朝天,解BL锁需要小米社区5及以上,所以不得不想想办法刷一刷小米社区的等级,这里同样是用得青龙面板每天定时执行,原脚本是单账号,这里动手改了多账号。

代码如下:

import requests,json,time,base64,binascii,hashlib,datetime,sys
class Account:
    def __init__(self, username, password):
        self.username = username
        self.password = password
        self.cookie = {}

    def login(self):
        md5 = hashlib.md5()
        md5.update(self.password.encode())
        Hash = md5.hexdigest()
        sha1 = hashlib.sha1()
        url = 'https://account.xiaomi.com/pass/serviceLoginAuth2'
        headers = {'User-Agent':'Dalvik/2.1.0 (Linux; U; Android 12; Redmi K20 Pro Build/SKQ1.211006.001) APP/xiaomi.vipaccount APPV/231026 MK/UmVkbWkgSzIwIFBybw== SDKV/5.1.0.release.13 PassportSDK/5.1.0.release.15 passport-ui/5.1.0.release.15'}
        data = {'callback':'https://api.vip.miui.com/sts','_json':'true','user':self.username,'hash':Hash.upper(),'sid':'miui_vip','_sign':'ZJxpm3Q5cu0qDOMkKdWYRPeCwps=','_locale':'zh_CN'}
        Auth = json.loads(requests.post(url=url,headers=headers,data=data).text.replace('&&&START&&&',''))
        if Auth['description'] == '登录验证失败':
            print('登陆验证失败')
            sys.exit()
        sha1.update(('nonce=' + str(Auth['nonce']) + '&' + Auth['ssecurity']).encode('utf-8'))
        clientSign = base64.encodebytes(binascii.a2b_hex(sha1.hexdigest().encode('utf-8'))).decode(encoding='utf-8').strip()
        nurl = Auth['location'] + '&_userIdNeedEncrypt=true&clientSign=' + clientSign
        self.cookie = requests.utils.dict_from_cookiejar(requests.get(url=nurl).cookies)

    def info(self):
        url = 'https://api.vip.miui.com/mtop/planet/vip/homepage/mineInfo'
        result = requests.get(url=url,cookies=self.cookie).json()
        print(f'昵称:{result["entity"]["userInfo"]["userName"]} 等级:{result["entity"]["userInfo"]["userGrowLevelInfo"]["showLevel"]} 积分:{result["entity"]["userInfo"]["userGrowLevelInfo"]["point"]} ')

    def check_in(self):
        url = f'https://api.vip.miui.com/mtop/planet/vip/user/getUserCheckinInfo?miui_vip_ph={self.cookie["miui_vip_ph"]}'
        result = requests.get(url=url,cookies=self.cookie).json()
        if result['entity']['checkin7DaysDetail'][datetime.date.today().weekday()] == 0:
            url = f'https://api.vip.miui.com/mtop/planet/vip/user/checkinV2'
            data = {'miui_vip_ph':self.cookie['miui_vip_ph'],'token':'lUyu4a4aDS2xHr9Wm3RecATnT+1eNx9hP6T53vEQ3BK6fl0sqy3OaF7RPisuuHcEd16hgmBEOnYXhpa7HXjEX493lVmNr2KJ/ShoW8maSlBkHW2BwdRqQU19HLXcuvn7Ydfc3hP/sVLvjIHTqRFuGNzQlmMUSxZrBJ+e1Jjy2PGbpE44NI/jmbIRDcCJeieVcr6RbVoVj3ljnYZ6bRELiljNMDBumvg3Y77tXv4pDkkLpcGv2ngIdRcn60/uhviO0PxsOe1/gteRqcaYBpQSfGFMp1Dx1RQpMWLlNX5+0WZPGmupI6jE'}
            result = requests.post(url=url,cookies=self.cookie,data=data).json()
            if 'success' not in result['message']:
                print(f'签到失败: {result["message"]}')

    def like(self):
        url = 'https://api.vip.miui.com/mtop/planet/vip/content/announceThumbUp'
        data = {'postId':'36625780','sign':'36625780','timestamp':int(round(time.time()*1000))}
        requests.get(url=url,cookies=self.cookie,data=data)

    def browse(self):
        url = f'https://api.vip.miui.com/mtop/planet/vip/member/addCommunityGrowUpPointByActionV2?miui_vip_ph={self.cookie["miui_vip_ph"]}'
        for action in ['BROWSE_POST_10S','BROWSE_SPECIAL_PAGES_SPECIAL_PAGE','BROWSE_SPECIAL_PAGES_USER_HOME']:
            data = {'action':action,'miui_vip_ph':self.cookie['miui_vip_ph']}
            requests.post(url,cookies=self.cookie,data=data)

    def carrot(self):
        url ='https://api.vip.miui.com/api/carrot/pull'
        requests.post(url=url,cookies=self.cookie,params={'miui_vip_ph': self.cookie['miui_vip_ph']})

    def check_status(self):
        url = f'https://api.vip.miui.com/mtop/planet/vip/member/getCheckinPageCakeList?miui_vip_ph={self.cookie["miui_vip_ph"]}'
        result = requests.get(url=url,cookies=self.cookie).json()
        for i in result['entity'][2]['data']:
            if i['jumpText'] == '已完成':
                print(i['title'],'√')
            elif i['jumpText'] == '':
                print(i['title'],'×')

    def run(self):
        self.login()
        self.info()
        self.check_in()
        self.like()
        self.browse()
        self.carrot()
        self.check_status()

# 创建多个账号
accounts = [
    Account("UID", "password"),
    Account("UID", "password")
]

# 登录并执行操作
for account in accounts:
    account.run()
版权申明:
版权声明

①:本站文章均为原创,除非另有说明,否则本站内容依据CC BY-NC-SA 4.0许可证进行授权,转载请附上出处链接,谢谢。
②:本站提供的所有资源均为网上搜集,不保证能100%完整,如有涉及或侵害到您的版权请立即通知我们。
③:本站所有下载文件,仅用作学习研究使用,请下载后24小时内删除,支持正版,勿用作商业用途。
④:本站保证所提供资源的完整性,但不含授权许可、帮助文档、XML文件、PSD、后续升级等。
⑤:使用该资源需要用户有一定代码基础知识!由本站提供的资源对您的网站或计算机造成严重后果的本站概不负责。
⑥:本站资源售价只是赞助,收取费用仅维持本站的日常运营所需。
⑦:如果喜欢本站资源,欢迎捐助本站开通会员享受优惠折扣,谢谢支持!
⑧:如果网盘地址失效,请在相应资源页面下留言,我们会尽快修复下载地址。

1

评论1

请先

  1. 签到失败: 人机校验失败 每日签到 × 会更新吗?
    371897116 2024-02-27 0
会员低至49元,开通享海量VIP资源免费下载 自助开通
显示验证码
没有账号?注册  忘记密码?