Skip to content

Commit 9409533

Browse files
committed
init file
1 parent e45521b commit 9409533

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Tools
2+
- Python3
3+
- Fiddler4
4+
- Android&iOS device
5+
6+
## Description
7+
联通自动签到领金币多用户版
8+
##### 程序修改自[LTSignIn](https://github.com/pbbqdd/LTSignIn/tree/dev)
9+
- 增加多用户
10+
- 修复没有进行签到请求
11+
- 增加一些判断输出
12+
13+
## Config
14+
- phone : 电话号码 (非签到必须,只为查看日志方便)
15+
- url : fiddler 抓取登录请求
16+
> (exp:isRemberPwd=true&deviceId=000000000000000&password=**********&netWay=WIFI&mobile=*******************&timestamp=20181017230801&appId=1406a14ec25d9b783bc0fd29eacd072acfdae2811573d8d00d001205217142b4&keyVersion=1&deviceBrand=unknown&areaCode=940&version=android%405.93&deviceModel=Custom%20Phone%20-%205.1.0%20-%20API%2022%20-%20768x1280&deviceOS=android5.1&deviceCode=000000000000000)
17+
18+
## Maybe you need to see it
19+
- Linux用户记得先赋予脚本执行权限
20+
21+
- photo by mixool
22+
![session.png](https://camo.githubusercontent.com/170c92bb6fa12df634703d3205103384382a6bf5/68747470733a2f2f692e6c6f6c692e6e65742f323031392f30342f32382f356363353532356239323030342e706e67)

config_unicom.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"accounts":
3+
[
4+
{
5+
"phone": "13288888888",
6+
"url": "isRemberPwd=true&deviceId=000000000000000&password=**********&netWay=WIFI&mobile=*******************&timestamp=20181017230801&appId=1406a14ec25d9b783bc0fd29eacd072acfdae2811573d8d00d001205217142b4&keyVersion=1&deviceBrand=unknown&areaCode=940&version=android%405.93&deviceModel=Custom%20Phone%20-%205.1.0%20-%20API%2022%20-%20768x1280&deviceOS=android5.1&deviceCode=000000000000000"
7+
}
8+
,{
9+
"phone": "13188888888",
10+
"url": "isRemberPwd=true&deviceId=000000000000000&password=**********&netWay=WIFI&mobile=*******************&timestamp=20181017230801&appId=1406a14ec25d9b783bc0fd29eacd072acfdae2811573d8d00d001205217142b4&keyVersion=1&deviceBrand=unknown&areaCode=940&version=android%405.93&deviceModel=Custom%20Phone%20-%205.1.0%20-%20API%2022%20-%20768x1280&deviceOS=android5.1&deviceCode=000000000000000"
11+
}
12+
]
13+
}

unicom_qiandao.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# coding=utf-8
2+
# author: pbbqdd
3+
# modify: wfion
4+
import http.cookiejar
5+
import json
6+
import os
7+
import time
8+
import urllib.request as urllib2
9+
10+
11+
class Qiandao():
12+
13+
def __init__(self):
14+
self.timestamp = time.strftime("%Y%m%d%H%M%S", time.localtime())
15+
self.cookie = http.cookiejar.CookieJar()
16+
self.handler = urllib2.HTTPCookieProcessor(self.cookie)
17+
opener = urllib2.build_opener(self.handler)
18+
urllib2.install_opener(opener)
19+
20+
def sign(self, url_add, user_phone):
21+
req2 = urllib2.Request("http://m.client.10010.com/mobileService/login.htm",
22+
url_add.encode('utf-8') + self.timestamp.encode('utf-8'))
23+
if urllib2.urlopen(req2).getcode() == 200:
24+
print('login success!')
25+
try:
26+
for item1 in self.cookie:
27+
if item1.name == 'a_token':
28+
a = item1.value
29+
except:
30+
print("cant get cookies")
31+
req3 = urllib2.Request("https://act.10010.com/SigninApp/signin/querySigninActivity.htm?token=" + a)
32+
if urllib2.urlopen(req3).getcode() == 200:
33+
print('querySigninActivity success!')
34+
req4 = urllib2.Request("https://act.10010.com/SigninApp/signin/daySign.do", "btnPouplePost".encode('utf-8'))
35+
if urllib2.urlopen(req4).getcode() == 200:
36+
print('daySign success!')
37+
req5 = urllib2.Request("https://act.10010.com/SigninApp/signin/goldTotal.do")
38+
print('phone: ' + user_phone + ' coin: ' + urllib2.urlopen(req5).read().decode('utf-8'))
39+
40+
41+
if __name__ == '__main__':
42+
path = os.path.dirname(os.path.abspath(__file__))
43+
try:
44+
with open(path + '/config_unicom.json', 'r', encoding='utf-8') as f:
45+
dict_config = json.loads(f.read())
46+
try:
47+
account_list = dict_config['accounts']
48+
except KeyError as e:
49+
print('当前路径' + path + ' 配置文件错误,请检查config_unicom.json', e)
50+
i = 0
51+
datalist = []
52+
53+
for item in account_list:
54+
i += 1
55+
try:
56+
phone = item['phone']
57+
url = item['url']
58+
except KeyError as e:
59+
print('第%d个账户实例配置出错,跳过该账户' % i, e)
60+
continue
61+
62+
user = Qiandao()
63+
user.sign(url, phone)
64+
65+
except ValueError as e:
66+
print('出错了', e)
67+
except FileNotFoundError as e:
68+
print('当前路径' + path + ' 未找到config_unicom.json配置文件', e)
69+
except json.JSONDecodeError as e:
70+
print('config_unicom.json格式有误', e)

0 commit comments

Comments
 (0)