添加【芒果TV】每日签到脚本(待测试);

🐛 修复【吾爱破解】日志信息部分代码错误;
🔧 适配【芒果TV】配置及其渲染部署;
🔧 添加【芒果TV】参数获取文档。
This commit is contained in:
shitao 2021-03-01 19:34:36 +08:00
parent 3cc25910a7
commit bf0626da3a
11 changed files with 116 additions and 8 deletions

View File

@ -61,6 +61,7 @@ jobs:
CLOUD189_ACCOUNT_LIST: ${{secrets.CLOUD189_ACCOUNT_LIST}}
WPS_COOKIE_LIST: ${{secrets.WPS_COOKIE_LIST}}
POJIE_COOKIE_LIST: ${{secrets.POJIE_COOKIE_LIST}}
MGTV_PARAMS_LIST: ${{secrets.MGTV_PARAMS_LIST}}
- name: "部署到腾讯云函数"
run: sls deploy --debug

View File

@ -57,4 +57,5 @@ jobs:
ACFUN_ACCOUNT_LIST: ${{secrets.ACFUN_ACCOUNT_LIST}}
CLOUD189_ACCOUNT_LIST: ${{secrets.CLOUD189_ACCOUNT_LIST}}
WPS_COOKIE_LIST: ${{secrets.WPS_COOKIE_LIST}}
POJIE_COOKIE_LIST: ${{secrets.POJIE_COOKIE_LIST}}
POJIE_COOKIE_LIST: ${{secrets.POJIE_COOKIE_LIST}}
MGTV_PARAMS_LIST: ${{secrets.MGTV_PARAMS_LIST}}

View File

@ -53,6 +53,7 @@
|签到|[天翼云盘](https://cloud.189.cn/)|每日签到|每天一次|
|签到|[WPS](https://www.wps.cn/)|每日签到|每天一次|
|签到|[吾爱破解](https://www.52pojie.cn/index.php)|每日签到|每天一次|
|签到|芒果 TV|签到获取体验会员|每天一次|
|签到|联通营业厅|每日签到|每天一次|
|签到|Fa米家 APP|连续签到7天总计获得6粒Fa米粒每月15号23.59分清空Fa米粒。理论一个月最少获得24粒fa米粒。|每天一次|
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|

View File

@ -200,5 +200,13 @@
{
"pojie_cookie": "帐号2 cookie"
}
],
"MGTV_PARAMS_LIST": [
{
"mgtv_params": "账号1 params"
},
{
"mgtv_params": "账号2 params"
}
]
}

View File

@ -32,6 +32,7 @@ if [[ $MIMOTION_ACCOUNT_LIST ]]; then echo "MIMOTION_ACCOUNT_LIST 变量存在
if [[ $ACFUN_ACCOUNT_LIST ]]; then echo "ACFUN_ACCOUNT_LIST 变量存在,并成功赋值" ;else ACFUN_ACCOUNT_LIST=[]; fi;
if [[ $WPS_COOKIE_LIST ]]; then echo "WPS_COOKIE_LIST 变量存在,并成功赋值" ;else WPS_COOKIE_LIST=[]; fi;
if [[ $POJIE_COOKIE_LIST ]]; then echo "POJIE_COOKIE_LIST 变量存在,并成功赋值" ;else POJIE_COOKIE_LIST=[]; fi;
if [[ $MGTV_PARAMS_LIST ]]; then echo "MGTV_PARAMS_LIST 变量存在,并成功赋值" ;else MGTV_PARAMS_LIST=[]; fi;
if [[ $CLOUD189_ACCOUNT_LIST ]]; then echo "CLOUD189_ACCOUNT_LIST 变量存在,并成功赋值" ;else CLOUD189_ACCOUNT_LIST=[]; fi;
@ -69,6 +70,7 @@ JSONSTR="{
\"CLOUD189_ACCOUNT_LIST\": ${CLOUD189_ACCOUNT_LIST},
\"WPS_COOKIE_LIST\": ${WPS_COOKIE_LIST},
\"POJIE_COOKIE_LIST\": ${POJIE_COOKIE_LIST},
\"MGTV_PARAMS_LIST\": ${MGTV_PARAMS_LIST},
\"TIEBA_COOKIE_LIST\": ${TIEBA_COOKIE_LIST}
}"
echo $JSONSTR > config/config.json

View File

@ -30,8 +30,8 @@
|签到|[AcFun](https://www.acfun.cn/)|每日签到|每天一次|
|签到|[天翼云盘](https://cloud.189.cn/)|每日签到|每天一次|
|签到|[WPS](https://www.wps.cn/)|每日签到|每天一次|
|签到|[盖乐世社区](http://www.samsungmembers.cn/)|每日签到|每天一次|
|签到|[吾爱破解](https://www.52pojie.cn/index.php)|每日签到|每天一次|
|签到|芒果 TV|签到获取体验会员|每天一次|
|签到|联通营业厅|每日签到|每天一次|
|签到|Fa米家 APP|连续签到7天总计获得6粒Fa米粒每月15号23.59分清空Fa米粒。理论一个月最少获得24粒fa米粒。|每天一次|
|羊毛|喜马拉雅极速版|金币获取|30分钟一次|

View File

@ -58,8 +58,9 @@
|_**FMAPP_ACCOUNT_LIST**_.fmapp_cookie|Fa米家|APP|Fa米家 APP headers 中的 cookie|
|_**FMAPP_ACCOUNT_LIST**_.fmapp_device_id|Fa米家|APP|Fa米家 APP headers 中的 deviceId|
|_**XMLY_COOKIE_LIST**_.xmly_cookie|喜马拉雅极速版|APP|喜马拉雅极速版 cookie|
|_**ACFUN_ACCOUNT_LIST**_.acfun_phone|[AcFun](https://www.acfun.cn/)|APP|AcFun 每日签到|
|_**ACFUN_ACCOUNT_LIST**_.acfun_password|[AcFun](https://www.acfun.cn/)|APP|AcFun 每日签到|
|_**ACFUN_ACCOUNT_LIST**_.acfun_phone|[AcFun](https://www.acfun.cn/)|APP|AcFun 手机账号|
|_**ACFUN_ACCOUNT_LIST**_.acfun_password|[AcFun](https://www.acfun.cn/)|APP|AcFun 账号密码|
|_**MGTV_PARAMS_LIST**_.mgtv_params|芒果 TV|APP|芒果 TV 请求参数|
### 其他任务配置
@ -115,6 +116,20 @@
### APP 抓包
#### 芒果 TV 请求参数
抓包 APP 中获取 url 关键词 `credits.bz.mgtv.com/user/creditsTake`,提取 `?` 后所有参数
**示例**
```json
[
{
"mgtv_params": "uuid=xxx&uid=xxx&ticket=xxx&token=xxx&device=iPhone&did=xxx&deviceId=xxx&appVersion=6.8.2&osType=ios&platform=iphone&abroad=0&aid=xxx&nonce=xxx&timestamp=1614595550&appid=xxx&type=1&sign=xxx&callback=__jp18"
}
]
```
#### 喜马拉雅极速版 Cookie 参数获取
抓包 APP 中域名为 `m.ximalaya.com` 中的 `cookie` 即可
@ -377,6 +392,14 @@
{
"pojie_cookie": "帐号2 cookie"
}
],
"MGTV_PARAMS_LIST": [
{
"mgtv_params": "账号1 params"
},
{
"mgtv_params": "账号2 params"
}
]
}
```

2
mgtv/__init__.py Normal file
View File

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

69
mgtv/mgtv.py Normal file
View File

@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-
import json
import os
import time
from urllib import parse
import requests
class MgtvCheckIn:
def __init__(self, mgtv_params_list):
self.mgtv_params_list = mgtv_params_list
@staticmethod
def sign(params):
url = "https://credits.bz.mgtv.com/user/creditsTake"
user_params = {
"abroad": params.get("abroad"),
"ageMode": "0",
"appVersion": params.get("appVersion"),
"artistId": params.get("uuid"),
"device": params.get("device"),
"did": params.get("did"),
"mac": params.get("did"),
"osType": params.get("osType"),
"src": "mgtv",
"testversion": "",
"ticket": params.get("ticket"),
"uuid": params.get("uuid"),
}
try:
user_info = requests.get(
url="https://homepage.bz.mgtv.com/v2/user/userInfo",
params=user_params
).json()
username = user_info.get("data", {}).get("nickName")
except Exception as e:
print("获取用户信息失败", e)
username = params.get("uuid")
res = requests.get(url=url, params=params)
res_json = json.loads(res.text.replace(f"{params.get('callback')}(", "").replace(");", ""))
if res_json["code"] == 200:
cur_day = res_json["data"]["curDay"]
_credits = res_json["data"]["credits"]
msg = f"帐号信息: {username}\n签到积分: +{_credits}积分\n已经签到: {cur_day}天/21天"
else:
msg = f"帐号信息: {username}\n签到状态: 已完成签到 or 签到失败"
return msg
def main(self):
msg_list = []
for mgtv_cookie in self.mgtv_params_list:
mgtv_params = mgtv_cookie.get("mgtv_params")
params = parse.parse_qs(mgtv_params)
params["timestamp"] = [round(time.time())]
params = {key: value[0] for key, value in params.items()}
sign_msg = self.sign(params=params)
msg = f"【芒果TV】\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/config.json"), "r", encoding="utf-8"
) as f:
datas = json.loads(f.read())
_mgtv_params_list = datas.get("MGTV_PARAMS_LIST", [])
MgtvCheckIn(mgtv_params_list=_mgtv_params_list).main()

View File

@ -12,22 +12,21 @@ class PojieCheckIn:
@staticmethod
def sign(headers):
msg = ""
try:
msg = ""
session = requests.session()
session.get(url="https://www.52pojie.cn/home.php?mod=task&do=apply&id=2", headers=headers)
resp = session.get(url="https://www.52pojie.cn/home.php?mod=task&do=draw&id=2", headers=headers)
content = re.findall(r'<div id="messagetext".*?\n<p>(.*?)</p>', resp.text)[0]
if "您需要先登录才能继续本操作" in resp.text:
msg += "吾爱破解 cookie 失效"
elif "安域防护节点" in resp.text:
msg += "触发吾爱破解安全防护,访问出错。自行修改脚本运行时间和次数,总有能访问到的时间"
elif "恭喜" in resp.text:
msg += "吾爱破解签到成功"
else:
msg += content
except Exception as e:
if "安域防护节点" in resp.text:
print("触发吾爱破解安全防护,访问出错。自行修改脚本运行时间和次数,总有能访问到的时间")
print("吾爱破解出错")
msg += "吾爱破解出错"
return msg

View File

@ -10,6 +10,7 @@ from fmapp import FMAPPCheckIn
from iqiyi import IQIYICheckIn
from kgqq import KGQQCheckIn
from liantong import LianTongCheckIn
from mgtv import MgtvCheckIn
from mimotion import MiMotion
from music163 import Music163CheckIn
from oneplusbbs import OnePlusBBSCheckIn
@ -27,6 +28,7 @@ from youdao import YouDaoCheckIn
checkin_map = {
"IQIYI_COOKIE_LIST": IQIYICheckIn,
"VQQ_COOKIE_LIST": VQQCheckIn,
"MGTV_PARAMS_LIST": MgtvCheckIn,
"KGQQ_COOKIE_LIST": KGQQCheckIn,
"MUSIC163_ACCOUNT_LIST": Music163CheckIn,
"BILIBILI_COOKIE_LIST": BiliBiliCheckIn,