Skip to content

Instantly share code, notes, and snippets.

@Y4er
Created December 23, 2018 14:20
Show Gist options
  • Save Y4er/1edab32e9646022e589a61f0f59da103 to your computer and use it in GitHub Desktop.
Save Y4er/1edab32e9646022e589a61f0f59da103 to your computer and use it in GitHub Desktop.
垃圾指点天下app签到脚本
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author:Y4er
import requests
import json
import hashlib
def getToken(phone,password):
url = 'http://app.zhidiantianxia.cn/api/Login/pwd'
headers = {
'Host': 'app.zhidiantianxia.cn',
'Content-Type': 'application/x-www-form-urlencoded',
'User-Agent': 'okhttp/3.10.0'
}
params = {
'phone': phone,
'password': password,
'mobileSystem': '8.1.0',
'appVersion': '1.1.4',
'mobileVersion': 'MI 6X',
'deviceToken': '1507bfd3f7ec78ab60e'
}
token = requests.post(url,params=params,headers=headers).json()['data']
return token
def qianDao(phone,token):
url = 'http://zzrvtc.zhidiantianxia.cn/applets/signin/sign'
headers = {
'axy-phone': phone,
'axy-token': token,
'Content-Type': 'application/json',
'user-agent': 'MI 6X(Android/8.1.0) (com.axy.zhidian/1.1.4) Weex/0.18.0 1080x2030',
'Host': 'zzrvtc.zhidiantianxia.cn'
}
payload = {"lat":"34.794349","lng":"113.887287","signInId":1562}
res = requests.post(url,headers=headers,data=json.dumps(payload)).json()['msg']
print("手机号:{0} 签到结果:{1}".format(phone,res))
def getPhoneAndPass():
results = []
with open('password.txt','r',encoding='utf-8') as f:
for line in f.readlines():
line = line.strip('\n')
phone = line.split('|')[0]
password = line.split('|')[1]
m = hashlib.md5()
m.update(b"axy_" + bytes(password,encoding = "utf8"))
password = m.hexdigest()
results.append([phone,password])
f.close()
return results
if __name__ == '__main__':
results = getPhoneAndPass()
for phone,password in results:
token = getToken(phone, password)
qianDao(phone,token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment