🔨 添加【联通沃邮箱】每日签到脚本 感谢水友@什么大风大浪都见过 提供脚本

This commit is contained in:
Sitoi 2021-04-28 18:45:47 +08:00
parent 5133fcb58d
commit 7fdd843daf
9 changed files with 146 additions and 1 deletions

View File

@ -85,6 +85,7 @@ jobs:
DUOKAN_COOKIE_LIST: ${{secrets.DUOKAN_COOKIE_LIST}}
CSDN_COOKIE_LIST: ${{secrets.CSDN_COOKIE_LIST}}
WZYD_DATA_LIST: ${{secrets.WZYD_DATA_LIST}}
WOMAIL_URL_LIST: ${{secrets.WOMAIL_URL_LIST}}
- name: "部署到腾讯云函数"
run: sls deploy --debug

View File

@ -75,3 +75,4 @@ jobs:
DUOKAN_COOKIE_LIST: ${{secrets.DUOKAN_COOKIE_LIST}}
CSDN_COOKIE_LIST: ${{secrets.CSDN_COOKIE_LIST}}
WZYD_DATA_LIST: ${{secrets.WZYD_DATA_LIST}}
WOMAIL_URL_LIST: ${{secrets.WOMAIL_URL_LIST}}

View File

@ -64,6 +64,7 @@
|签到|[MEIZU 社区](https://bbs.meizu.cn)|每日签到、可配置抽奖|WEB|待测试|🟢️|
|签到|[智友邦](http://zhizhiyoo.net/)|每日签到获取金币|WEB|待测试|🟢️|
|签到|[CSDN](https://www.csdn.net/)|每日签到、抽奖|WEB|待测试|🟢️|
|签到|联通沃邮箱|每日签到、抽奖|小程序|待测试|🟡|
|签到|王者营地|每日签到(仅限 QQ 区)|APP|待测试|🟢|
|签到|微博|每日钱包签到、打卡|APP|待测试|🟢️|
|签到|多看阅读|获取书豆,用于购买书籍|APP|待测试|🟢️|
@ -112,6 +113,8 @@
<details>
<summary>更新日志(点击展开)</summary>
- 2021-04-28
* 添加【联通沃邮箱】每日签到脚本 感谢水友`@什么大风大浪都见过` 提供脚本
- 2021-04-07
* 添加【王者营地】每日签到脚本
* 添加【CSDN】每日签到脚本

View File

@ -25,6 +25,7 @@ from v2ex import V2exCheckIn
from vqq import VQQCheckIn
from weather import Weather
from weibo import WeiBoCheckIn
from womail import WoMailCheckIn
from wps import WPSCheckIn
from www2nzz import WWW2nzzCheckIn
from wzyd import WZYDCheckIn
@ -59,6 +60,7 @@ checkin_map = {
"DUOKAN_COOKIE_LIST": ("多看阅读", DuoKanCheckIn),
"CSDN_COOKIE_LIST": ("CSDN", CSDNCheckIn),
"WZYD_DATA_LIST": ("王者营地", WZYDCheckIn),
"WOMAIL_URL_LIST": ("沃邮箱", WoMailCheckIn),
"CITY_NAME_LIST": ("天气预报", Weather),
}

View File

@ -272,5 +272,13 @@
{
"wzyd_data": "多账号 data 填写请参考上面data 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"WOMAIL_URL_LIST": [
{
"womail_url": "https://nyan.mail.wo.cn/cn/sign/index/index?mobile=xxxxxx&userName=&openId=xxxxxx"
},
{
"womail_url": "多账号 url 填写请参考上面url 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
]
}

View File

@ -39,6 +39,7 @@
|签到|[MEIZU 社区](https://bbs.meizu.cn)|每日签到、可配置抽奖|WEB|待测试|🟢️|
|签到|[智友邦](http://zhizhiyoo.net/)|每日签到获取金币|WEB|待测试|🟢️|
|签到|[CSDN](https://www.csdn.net/)|每日签到、抽奖|WEB|待测试|🟢️|
|签到|联通沃邮箱|每日签到、抽奖|小程序|待测试|🟡|
|签到|王者营地|每日签到(仅限 QQ 区)|APP|待测试|🟢|
|签到|微博|每日钱包签到、打卡|APP|待测试|🟢️|
|签到|多看阅读|获取书豆,用于购买书籍|APP|待测试|🟢️|

View File

@ -58,11 +58,19 @@
|_**ZHIYOO_COOKIE_LIST**_.zhiyoo_cookie|[智友邦](http://zhizhiyoo.net/)|Web| 智友邦 WEB Cookie|
|_**CSDN_COOKIE_LIST**_.csdn_cookie|[CSDN](https://www.csdn.net/)|Web| CSDN Cookie|
### 小程序签到配置
|Name|归属|属性|说明|
|:---:|:---:|:---:|:---|
|_**WOMAIL_URL_LIST**_.womail_url|联通沃邮箱|小程序|联通沃邮箱 小程序 `https://nyan.mail.wo.cn/cn/sign/index/index?mobile` 开头的 URL|
### APP 签到配置
|Name|归属|属性|说明|
|:---:|:---:|:---:|:---|
|_**LIANTONG_ACCOUNT_LIST**_.data|联通营业厅|APP|联通营业厅 每日签到|
|_**LIANTONG_ACCOUNT_LIST**_.data|联通营业厅|APP|联通营业厅 APP 请求中的 Body|
|_**FMAPP_ACCOUNT_LIST**_.fmapp_token|Fa米家|APP|Fa米家 APP headers 中的 token|
|_**FMAPP_ACCOUNT_LIST**_.fmapp_cookie|Fa米家|APP|Fa米家 APP headers 中的 cookie|
|_**FMAPP_ACCOUNT_LIST**_.fmapp_blackbox|Fa米家|APP|Fa米家 APP headers 中的 blackBox|
@ -450,6 +458,14 @@
{
"wzyd_data": "多账号 data 填写请参考上面data 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
],
"WOMAIL_URL_LIST": [
{
"womail_url": "https://nyan.mail.wo.cn/cn/sign/index/index?mobile=xxxxxx&userName=&openId=xxxxxx"
},
{
"womail_url": "多账号 url 填写请参考上面url 以实际获取为准(遇到特殊字符如双引号\" 请加反斜杠转义)"
}
]
}
```

2
womail/__init__.py Normal file
View File

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

111
womail/womail.py Normal file
View File

@ -0,0 +1,111 @@
# -*- coding: utf-8 -*-
import json
import os
import re
import requests
class WoMailCheckIn:
def __init__(self, check_item):
self.check_item = check_item
@staticmethod
def login(womail_url):
try:
url = womail_url
headers = {
"User-Agent": "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3868.400 QQBrowser/10.8.4394.400"
}
res = requests.get(url=url, headers=headers, allow_redirects=False)
set_cookie = res.headers["Set-Cookie"]
cookies = re.findall("YZKF_SESSION.*?;", set_cookie)[0]
if "YZKF_SESSION" in cookies:
return cookies
else:
print("沃邮箱获取 cookies 失败")
return None
except Exception as e:
print("沃邮箱错误:", e)
return None
@staticmethod
def dotask(cookies):
msg = ""
headers = {
"User-Agent": "User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3868.400 QQBrowser/10.8.4394.400",
"Cookie": cookies,
}
try:
url = "https://nyan.mail.wo.cn/cn/sign/index/userinfo.do?rand=0.8897817905278955"
res = requests.post(url=url, headers=headers)
result = res.json()
wxName = result.get("result").get("wxName")
userMobile = result.get("result").get("userMobile")
userdata = f"帐号信息: {wxName} - {userMobile[:3]}****{userMobile[-4:]}\n"
msg += userdata
except Exception as e:
print("沃邮箱获取用户信息失败", e)
msg += "沃邮箱获取用户信息失败\n"
try:
url = "https://nyan.mail.wo.cn/cn/sign/user/checkin.do?rand=0.913524814493383"
res = requests.post(url=url, headers=headers).json()
result = res.get("result")
if result == -2:
msg += "每日签到: 已签到\n"
elif result is None:
msg += f"每日签到: 签到失败\n"
else:
msg += f"每日签到: 签到成功~已签到{result}天!\n"
except Exception as e:
print("沃邮箱签到错误", e)
msg += "沃邮箱签到错误\n"
try:
url = "https://nyan.mail.wo.cn/cn/sign/user/doTask.do?rand=0.8776674762904109"
data_params = {
"每日首次登录手机邮箱": {"taskName": "loginmail"},
"和WOWO熊一起寻宝": {"taskName": "treasure"},
"去用户俱乐部逛一逛": {"taskName": "club"},
}
for key, data in dict.items(data_params):
try:
res = requests.post(url=url, data=data, headers=headers).json()
result = res.get("result")
if result == 1:
msg += f"{key}: 做任务成功\n"
elif result == -1:
msg += f"{key}: 任务已做过\n"
elif result == -2:
msg += f"{key}: 请检查登录状态\n"
else:
msg += f"{key}: 未知错误\n"
except Exception as e:
print(f"沃邮箱执行任务【{key}】错误", e)
msg += f"沃邮箱执行任务【{key}】错误"
except Exception as e:
print("沃邮箱执行任务错误", e)
msg += "沃邮箱执行任务错误错误"
return msg
def main(self):
womail_url = self.check_item.get("womail_url")
try:
cookies = self.login(womail_url)
if cookies:
msg = self.dotask(cookies)
else:
msg = "登录失败"
except Exception as e:
print(e)
msg = "登录失败"
return msg
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())
_check_item = datas.get("WOMAIL_URL_LIST", [])[1]
print(WoMailCheckIn(check_item=_check_item).main())