feat: 添加天翼云盘签到

This commit is contained in:
shitao 2021-01-27 23:10:55 +08:00
parent 259631d813
commit 2db74595bf
11 changed files with 195 additions and 0 deletions

View File

@ -57,6 +57,7 @@ jobs:
SMZDM_COOKIE_LIST: ${{secrets.SMZDM_COOKIE_LIST}}
MIMOTION_ACCOUNT_LIST: ${{secrets.MIMOTION_ACCOUNT_LIST}}
ACFUN_ACCOUNT_LIST: ${{secrets.ACFUN_ACCOUNT_LIST}}
CLOUD189_ACCOUNT_LIST: ${{secrets.CLOUD189_ACCOUNT_LIST}}
- name: "部署到腾讯云函数"
run: sls deploy --debug

View File

@ -55,3 +55,4 @@ jobs:
SMZDM_COOKIE_LIST: ${{secrets.SMZDM_COOKIE_LIST}}
MIMOTION_ACCOUNT_LIST: ${{secrets.MIMOTION_ACCOUNT_LIST}}
ACFUN_ACCOUNT_LIST: ${{secrets.ACFUN_ACCOUNT_LIST}}
CLOUD189_ACCOUNT_LIST: ${{secrets.CLOUD189_ACCOUNT_LIST}}

View File

@ -49,6 +49,7 @@
|签到|[咔叽网单](https://www.2nzz.com/)|每日签到|每天一次|
|签到|[什么值得买](https://www.smzdm.com)|每日签到|每天一次|
|签到|[AcFun](https://www.acfun.cn/)|每日签到|每天一次|
|签到|[天翼云盘](https://cloud.189.cn/)|每日签到|每天一次|
|签到|联通营业厅|每日签到|每天一次|
|签到|Fa米家 APP|连续签到7天总计获得6粒Fa米粒每月15号23.59分清空Fa米粒。理论一个月最少获得24粒fa米粒。|每天一次|
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|

2
cloud189/__init__.py Normal file
View File

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from cloud189.cloud189 import Cloud189CheckIn

144
cloud189/cloud189.py Normal file
View File

@ -0,0 +1,144 @@
# -*- coding: utf-8 -*-
import base64
import json
import os
import re
import time
import requests
import rsa
class Cloud189CheckIn:
def __init__(self, cloud189_account_list):
self.cloud189_account_list = cloud189_account_list
self.b64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
@staticmethod
def int2char(a):
return list("0123456789abcdefghijklmnopqrstuvwxyz")[a]
def b64tohex(self, a):
d = ""
e = 0
c = 0
for i in range(len(a)):
if list(a)[i] != "=":
v = self.b64map.index(list(a)[i])
if 0 == e:
e = 1
d += self.int2char(v >> 2)
c = 3 & v
elif 1 == e:
e = 2
d += self.int2char(c << 2 | v >> 4)
c = 15 & v
elif 2 == e:
e = 3
d += self.int2char(c)
d += self.int2char(v >> 2)
c = 3 & v
else:
e = 0
d += self.int2char(c << 2 | v >> 4)
d += self.int2char(15 & v)
if e == 1:
d += self.int2char(c << 2)
return d
def rsa_encode(self, j_rsakey, string):
rsa_key = f"-----BEGIN PUBLIC KEY-----\n{j_rsakey}\n-----END PUBLIC KEY-----"
pubkey = rsa.PublicKey.load_pkcs1_openssl_pem(rsa_key.encode())
result = self.b64tohex((base64.b64encode(rsa.encrypt(f"{string}".encode(), pubkey))).decode())
return result
def login(self, session, username, password):
url = "https://cloud.189.cn/udb/udb_login.jsp?pageId=1&redirectURL=/main.action"
r = session.get(url=url)
captchatoken = re.findall(r"captchaToken' value='(.+?)'", r.text)[0]
lt = re.findall(r'lt = "(.+?)"', r.text)[0]
returnurl = re.findall(r"returnUrl = '(.+?)'", r.text)[0]
paramid = re.findall(r'paramId = "(.+?)"', r.text)[0]
j_rsakey = re.findall(r'j_rsaKey" value="(\S+)"', r.text, re.M)[0]
session.headers.update({"lt": lt})
username = self.rsa_encode(j_rsakey, username)
password = self.rsa_encode(j_rsakey, password)
url = "https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/76.0",
"Referer": "https://open.e.189.cn/",
}
data = {
"appKey": "cloud",
"accountType": "01",
"userName": f"{{RSA}}{username}",
"password": f"{{RSA}}{password}",
"validateCode": "",
"captchaToken": captchatoken,
"returnUrl": returnurl,
"mailSuffix": "@189.cn",
"paramId": paramid,
}
r = session.post(url, data=data, headers=headers, timeout=5)
if r.json()["result"] == 0:
redirect_url = r.json()["toUrl"]
session.get(url=redirect_url)
return True
else:
return "登陆状态: " + r.json()["msg"]
@staticmethod
def sign(session):
rand = str(round(time.time() * 1000))
surl = f"https://api.cloud.189.cn/mkt/userSign.action?rand={rand}&clientType=TELEANDROID&version=8.6.3&model=SM-G930K"
url = "https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN&activityId=ACT_SIGNIN"
url2 = "https://m.cloud.189.cn/v2/drawPrizeMarketDetails.action?taskId=TASK_SIGNIN_PHOTOS&activityId=ACT_SIGNIN"
headers = {
"User-Agent": "Mozilla/5.0 (Linux; Android 5.1.1; SM-G930K Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.136 Mobile Safari/537.36 Ecloud/8.6.3 Android/22 clientId/355325117317828 clientModel/SM-G930K imsi/460071114317824 clientChannelId/qq proVersion/1.0.6",
"Referer": "https://m.cloud.189.cn/zhuanti/2016/sign/index.jsp?albumBackupOpened=1",
"Host": "m.cloud.189.cn",
"Accept-Encoding": "gzip, deflate",
}
response = session.get(url=surl, headers=headers)
netdiskbonus = response.json().get("netdiskBonus")
if response.json().get("isSign") == "false":
msg = f"签到结果: 未签到,签到获得 {netdiskbonus}M 空间"
else:
msg = f"签到结果: 已经签到过了,签到获得 {netdiskbonus}M 空间"
response = session.get(url=url, headers=headers)
if "errorCode" in response.text:
msg += f"\n第一次抽奖: {response.text}"
else:
description = response.json().get("description", "")
msg += f"\n第一次抽奖: 获得{description}"
response = session.get(url=url2, headers=headers)
if "errorCode" in response.text:
msg += f"\n第二次抽奖: {response.text}"
else:
description = response.json().get("description", "")
msg += f"\n第二次抽奖: 获得{description}"
return msg
def main(self):
msg_list = []
for cloud189_account in self.cloud189_account_list:
cloud189_phone = cloud189_account.get("cloud189_phone")
cloud189_password = cloud189_account.get("cloud189_password")
session = requests.Session()
flag = self.login(session=session, username=cloud189_phone, password=cloud189_password)
if flag is True:
sign_msg = self.sign(session=session)
else:
sign_msg = flag
msg = f"【天翼云盘】\n帐号信息: {cloud189_phone}\n{sign_msg}"
msg_list.append(msg)
return msg_list
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
datas = json.loads(f.read())
_cloud189_account_list = datas.get("CLOUD189_ACCOUNT_LIST", [])
Cloud189CheckIn(cloud189_account_list=_cloud189_account_list).main()

View File

@ -173,5 +173,15 @@
"acfun_phone": "帐号2 手机号",
"acfun_password": "帐号2 密码"
}
],
"CLOUD189_ACCOUNT_LIST": [
{
"cloud189_phone": "帐号1 手机号",
"cloud189_password": "帐号1 密码"
},
{
"cloud189_phone": "帐号2 手机号",
"cloud189_password": "帐号2 密码"
}
]
}

View File

@ -29,6 +29,7 @@ if [[ $WWW2NZZ_COOKIE_LIST ]]; then echo "WWW2NZZ_COOKIE_LIST 变量存在,并
if [[ $SMZDM_COOKIE_LIST ]]; then echo "SMZDM_COOKIE_LIST 变量存在,并成功赋值" ;else SMZDM_COOKIE_LIST=[]; fi;
if [[ $MIMOTION_ACCOUNT_LIST ]]; then echo "MIMOTION_ACCOUNT_LIST 变量存在,并成功赋值" ;else MIMOTION_ACCOUNT_LIST=[]; fi;
if [[ $ACFUN_ACCOUNT_LIST ]]; then echo "ACFUN_ACCOUNT_LIST 变量存在,并成功赋值" ;else ACFUN_ACCOUNT_LIST=[]; fi;
if [[ $CLOUD189_ACCOUNT_LIST ]]; then echo "CLOUD189_ACCOUNT_LIST 变量存在,并成功赋值" ;else CLOUD189_ACCOUNT_LIST=[]; fi;
JSONSTR="{
@ -61,6 +62,7 @@ JSONSTR="{
\"SMZDM_COOKIE_LIST\": ${SMZDM_COOKIE_LIST},
\"MIMOTION_ACCOUNT_LIST\": ${MIMOTION_ACCOUNT_LIST},
\"ACFUN_ACCOUNT_LIST\": ${ACFUN_ACCOUNT_LIST},
\"CLOUD189_ACCOUNT_LIST\": ${CLOUD189_ACCOUNT_LIST},
\"TIEBA_COOKIE_LIST\": ${TIEBA_COOKIE_LIST}
}"
echo $JSONSTR > config.json

View File

@ -173,5 +173,15 @@
"acfun_phone": "帐号2 手机号",
"acfun_password": "帐号2 密码"
}
],
"CLOUD189_ACCOUNT_LIST": [
{
"cloud189_phone": "帐号1 手机号",
"cloud189_password": "帐号1 密码"
},
{
"cloud189_phone": "帐号2 手机号",
"cloud189_password": "帐号2 密码"
}
]
}

View File

@ -28,6 +28,7 @@
|签到|[咔叽网单](https://www.2nzz.com/)|每日签到|每天一次|
|签到|[什么值得买](https://www.smzdm.com)|每日签到|每天一次|
|签到|[AcFun](https://www.acfun.cn/)|每日签到|每天一次|
|签到|[天翼云盘](https://cloud.189.cn/)|每日签到|每天一次|
|签到|联通营业厅|每日签到|每天一次|
|签到|Fa米家 APP|连续签到7天总计获得6粒Fa米粒每月15号23.59分清空Fa米粒。理论一个月最少获得24粒fa米粒。|每天一次|
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|

View File

@ -43,6 +43,8 @@
|_**V2EX_COOKIE_LIST**_.v2ex_cookie|[V2EX](https://www.v2ex.com/)|Web|V2EX 每日签到|
|_**WWW2NZZ_COOKIE_LIST**_.www2nzz_cookie|[咔叽网单](https://www.2nzz.com/)|Web|咔叽网单 每日签到|
|_**SMZDM_COOKIE_LIST**_.smzdm_cookie|[什么值得买](https://www.smzdm.com)|Web|什么值得买 每日签到|
|_**CLOUD189_ACCOUNT_LIST**_.cloud189_phone|[天翼云盘](https://cloud.189.cn/)|Web| 天翼云盘 手机号|
|_**CLOUD189_ACCOUNT_LIST**_.cloud189_password|[天翼云盘](https://cloud.189.cn/)|Web| 天翼云盘 手机号对应的密码|
### APP 签到配置
@ -96,11 +98,20 @@
#### AcFun 帐号信息
[AcFun](https://www.acfun.cn/)
- _**ACFUN_ACCOUNT_LIST**_.acfun_phone: AcFun 手机号
- _**ACFUN_ACCOUNT_LIST**_.acfun_password: AcFun 手机号对应的密码
#### 天翼云盘 帐号信息
[天翼云盘](https://cloud.189.cn/)
- _**CLOUD189_ACCOUNT_LIST**_.cloud189_phone: 天翼云盘 手机号
- _**CLOUD189_ACCOUNT_LIST**_.cloud189_password: 天翼云盘 手机号对应的密码
### APP 抓包
#### 喜马拉雅极速版 Cookie 参数获取
@ -331,6 +342,16 @@
"acfun_phone": "帐号2 手机号",
"acfun_password": "帐号2 密码"
}
],
"CLOUD189_ACCOUNT_LIST": [
{
"cloud189_phone": "帐号1 手机号",
"cloud189_password": "帐号1 密码"
},
{
"cloud189_phone": "帐号2 手机号",
"cloud189_password": "帐号2 密码"
}
]
}
```

View File

@ -5,6 +5,7 @@ import os
from acfun import AcFunCheckIn
from baidu_url_submit import BaiduUrlSubmit
from bilibili import BiliBiliCheckIn
from cloud189 import Cloud189CheckIn
from fmapp import FMAPPCheckIn
from iqiyi import IQIYICheckIn
from kgqq import KGQQCheckIn
@ -38,6 +39,7 @@ checkin_map = {
"WWW2NZZ_COOKIE_LIST": WWW2nzzCheckIn,
"ACFUN_ACCOUNT_LIST": AcFunCheckIn,
"MIMOTION_ACCOUNT_LIST": MiMotion,
"CLOUD189_ACCOUNT_LIST": Cloud189CheckIn,
"CITY_NAME_LIST": Weather,
"XMLY_COOKIE_LIST": XMLYCheckIn
}