├── .github └── workflows │ └── AutoRun.yml ├── Photo └── A86CC0F6-E719-47C2-9087-AA428FC88C00.jpeg ├── README.md ├── UnicomAutoGetCoin.py └── requirements.txt /.github/workflows/AutoRun.yml: -------------------------------------------------------------------------------- 1 | name: AutoRun 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | watch: 8 | types: started 9 | schedule: 10 | #格林尼治时间22:11,东八区北京时间6:11 11 | - cron: 11 22 * * * 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | if: github.event.repository.owner.id == github.event.sender.id 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@master 20 | - name: Install extensions 21 | run: | 22 | pip3 install setuptools 23 | - name: Run program 24 | env: 25 | cookie: ${{ secrets.COOKIE }} 26 | run: | 27 | python3 UnicomAutoGetCoin.py ${cookie} 28 | 29 | -------------------------------------------------------------------------------- /Photo/A86CC0F6-E719-47C2-9087-AA428FC88C00.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Gsangu/UnicomGetCoin/b339d15631af8e4474cb101a41ad263177a55def/Photo/A86CC0F6-E719-47C2-9087-AA428FC88C00.jpeg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### 本项目不再维护 4 | 5 | 6 | #联通营业厅签到领积分 7 | 8 | 9 | #更新日志 10 | 11 | #新增七日4GB流量包获取 12 | 13 | 14 | #使用方法 15 | 16 | 一、自己挂服务器 17 | 18 | 只需下载py文件,然后按照下面的操作抓包,最后将py文件倒数第二行的sys.argv[1]替换成抓包得到的cookie即可。 19 | 20 | 二、利用github的workflow自动运行 21 | 22 | 首先fork该项目,然后按照下面的操作抓包,进入setting里面找到secret,添加一个名为COOKIE的secret,将抓包到的cookie复制进去即可。 23 | 24 | 25 | #抓包方法及内容 26 | 27 | 手机营业厅退出登陆,开启抓包软件,登录手机营业厅 28 | 29 | 查找网址为 https://m.client.10010.com/mobileService/login.htm 的记录,找到请求文本,从&sim开始到最后后的内容就是所需要的 30 | 31 | 具体内容见下图 32 | 33 | ![Image Text](https://github.com/QiuYueBaiJXW/UnicomGetCoin/blob/master/Photo/A86CC0F6-E719-47C2-9087-AA428FC88C00.jpeg?raw=true) 34 | 35 | 36 | 37 | #无限期To Do 38 | 39 | 1.每日自动抽奖三次 40 | 41 | 2.改进登录方式,取消抓包登录,改用账号密码登录 42 | 43 | 3.还没想好,有啥好的想法欢迎issue。 44 | 45 | 46 | #免责申明 47 | 48 | 该项目仅供学习使用,严禁用于商业用途,由此造成的一切后果,本人概不负责。 49 | -------------------------------------------------------------------------------- /UnicomAutoGetCoin.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | # author:@QiuYueBai 3 | 4 | import http.cookiejar 5 | import json 6 | import os 7 | import sys 8 | import urllib.request as urllib2 9 | import ssl 10 | import urllib 11 | import datetime 12 | import requests 13 | import ssl 14 | 15 | ssl._create_default_https_context = ssl._create_unverified_context 16 | class Qiandao(): 17 | 18 | def __init__(self): 19 | self.cookie = http.cookiejar.CookieJar() 20 | self.handler = urllib2.HTTPCookieProcessor(self.cookie) 21 | self.opener = urllib2.build_opener(self.handler) 22 | urllib2.install_opener(self.opener) 23 | 24 | 25 | def sign(self,data): 26 | global a 27 | headers = { 28 | 'Host': 'm.client.10010.com', 29 | 'Accept': '*/*', 30 | 'Content-Type': 'application/x-www-form-urlencoded', 31 | 'Connection': 'keep-alive', 32 | 'Cookie': 'channel=GGPD; city=034|358; devicedId=FE0172BD-1BF5-4774-BC31-DD77360C3214; c_sfbm=234g_00; logHostIP=null; mobileService1=1Y4RfyPLLL0tvLpGnRK2QL5gQg1bDWSjnLvZ2RWKtWBWYywxWQpL!899433259; mobileServiceAll=dfd8b2e9f03c6c97f078fed5a9b73a86', 33 | 'User-Agent': 'ChinaUnicom4.x/230 CFNetwork/1128.0.1 Darwin/19.6.0', 34 | 'Accept-Language': 'zh-cn', 35 | 'Accept-Encoding': 'gzip, deflate, br', 36 | 'Content-Length': '910' 37 | } 38 | data = data.encode('utf-8') 39 | req2 = urllib2.Request("http://m.client.10010.com/mobileService/login.htm",headers=headers) 40 | req2 = urllib2.urlopen(req2,data) 41 | if req2.getcode() == 200: 42 | print('login success!') 43 | try: 44 | for item1 in self.cookie: 45 | if item1.name == 'a_token': 46 | a = item1.value 47 | except: 48 | print("cant get cookies") 49 | data2={'stepflag':'22'} 50 | data2=urllib.parse.urlencode(data2).encode('utf-8') 51 | 52 | req3 = urllib2.Request("https://act.10010.com/SigninApp/signin/querySigninActivity.htm?token=" + a) 53 | if urllib2.urlopen(req3).getcode() == 200: 54 | print('querySigninActivity success!') 55 | 56 | req4 = urllib2.Request("https://act.10010.com/SigninApp/signin/daySign", "btnPouplePost".encode('utf-8')) 57 | if urllib2.urlopen(req4).getcode() == 200: 58 | print('daySign success!') 59 | 60 | req5 = urllib2.Request("https://act.10010.com/SigninApp/signin/getIntegral") 61 | r = self.opener.open(req5) 62 | print( ' coin: ' + r.read().decode('utf-8')) 63 | 64 | data2={'stepflag':'22'} 65 | data2=urllib.parse.urlencode(data2).encode('utf-8') 66 | data3={'stepflag':'23'} 67 | data3=urllib.parse.urlencode(data3).encode('utf-8') 68 | for x in range(3): 69 | get_req6 = urllib2.Request("http://act.10010.com/SigninApp/mySignin/addFlow",data2) 70 | req6 = self.opener.open(get_req6) 71 | get_req7 = urllib2.Request("http://act.10010.com/SigninApp/mySignin/addFlow",data3) 72 | req7 = self.opener.open(get_req7) 73 | if __name__ == '__main__': 74 | 75 | user = Qiandao() 76 | 77 | timestamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') 78 | 79 | data = timestamp+sys.argv[1] 80 | 81 | user.sign(data) 82 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | datetime 2 | requests 3 | --------------------------------------------------------------------------------