fix: 修复 docker 挂载 config.json 修改不生效的 BUG。

feat: 添加基于 issue 的通知系统。
This commit is contained in:
shitao 2021-02-23 22:46:29 +08:00
parent 9e2cdebda1
commit d50bf39a70
36 changed files with 155 additions and 303 deletions

View File

@ -50,7 +50,9 @@ class AcFunCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_acfun_account_list = datas.get("ACFUN_ACCOUNT_LIST", [])
AcFunCheckIn(acfun_account_list=_acfun_account_list).main()

View File

@ -47,7 +47,9 @@ class BaiduUrlSubmit:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_baidu_url_submit_list = datas.get("BAIDU_URL_SUBMIT_LIST", [])
BaiduUrlSubmit(baidu_url_submit_list=_baidu_url_submit_list).main()

View File

@ -332,7 +332,9 @@ class BiliBiliCheckIn(object):
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_bilibili_cookie_list = datas.get("BILIBILI_COOKIE_LIST", [])
BiliBiliCheckIn(bilibili_cookie_list=_bilibili_cookie_list).main()

View File

@ -138,7 +138,9 @@ class Cloud189CheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_cloud189_account_list = datas.get("CLOUD189_ACCOUNT_LIST", [])
Cloud189CheckIn(cloud189_account_list=_cloud189_account_list).main()

View File

@ -73,6 +73,6 @@ JSONSTR="{
\"POJIE_COOKIE_LIST\": ${POJIE_COOKIE_LIST},
\"TIEBA_COOKIE_LIST\": ${TIEBA_COOKIE_LIST}
}"
echo $JSONSTR > config.json
echo $JSONSTR > config/config.json
cat config.json
cat config/config.json

View File

@ -1,212 +0,0 @@
{
"DINGTALK_SECRET": "xxxxxx",
"DINGTALK_ACCESS_TOKEN": "xxxxxx",
"SCKEY": "xxxxxx",
"SENDKEY": "xxxxxx",
"BARK_URL": "xxxxxx",
"QMSG_KEY": "xxxxxx",
"TG_BOT_TOKEN": "xxxxxx",
"TG_USER_ID": "xxxxxx",
"COOLPUSHSKEY": "xxxxxx",
"COOLPUSHQQ": true,
"COOLPUSHWX": true,
"COOLPUSHEMAIL": true,
"CITY_NAME_LIST": [
"上海"
],
"MOTTO": true,
"IQIYI_COOKIE_LIST": [
{
"iqiyi_cookie": "帐号1 cookie"
},
{
"iqiyi_cookie": "帐号2 cookie"
}
],
"VQQ_COOKIE_LIST": [
{
"vqq_cookie": "帐号1 cookie"
},
{
"vqq_cookie": "帐号2 cookie"
}
],
"YOUDAO_COOKIE_LIST": [
{
"youdao_cookie": "帐号1 cookie"
},
{
"youdao_cookie": "帐号2 cookie"
}
],
"KGQQ_COOKIE_LIST": [
{
"kgqq_cookie": "帐号1 cookie"
},
{
"kgqq_cookie": "帐号2 cookie"
}
],
"MUSIC163_ACCOUNT_LIST": [
{
"music163_phone": "帐号1 手机号",
"music163_password": "帐号1 密码"
},
{
"music163_phone": "帐号2 手机号",
"music163_password": "帐号2 密码"
}
],
"XMLY_COOKIE_LIST": [
{
"xmly_cookie": "帐号1 cookie"
},
{
"xmly_cookie": "帐号2 cookie"
}
],
"ONEPLUSBBS_COOKIE_LIST": [
{
"oneplusbbs_cookie": "帐号1 cookie"
},
{
"oneplusbbs_cookie": "帐号2 cookie"
}
],
"BAIDU_URL_SUBMIT_LIST": [
{
"data_url": "https://cdn.jsdelivr.net/gh/Sitoi/Sitoi.github.io/baidu_urls.txt",
"submit_url": "http://data.zz.baidu.com/urls?site=https://sitoi.cn&token=xxxxxx",
"times": 10
},
{
"data_url": "帐号2 data_url",
"submit_url": "帐号2 submit_url",
"times": 10
}
],
"FMAPP_ACCOUNT_LIST": [
{
"fmapp_token": "帐号1 token",
"fmapp_cookie": "帐号1 cookie",
"fmapp_device_id": "帐号1 device_id"
},
{
"fmapp_token": "帐号2 token",
"fmapp_cookie": "帐号2 cookie",
"fmapp_device_id": "帐号2 device_id"
}
],
"TIEBA_COOKIE_LIST": [
{
"tieba_cookie": "帐号1 cookie"
},
{
"tieba_cookie": "帐号2 cookie"
}
],
"BILIBILI_COOKIE_LIST": [
{
"bilibili_cookie": "帐号1 cookie",
"coin_num": 0,
"coin_type": 1,
"silver2coin": true
},
{
"bilibili_cookie": "帐号2 cookie",
"coin_num": 0,
"coin_type": 1,
"silver2coin": true
}
],
"LIANTONG_ACCOUNT_LIST": [
{
"data": "simCount=1&version=iphone_c@8.0100&mobile=xxxxxx&netWay=wifi&isRemberPwd=false&appId=xxxxxx&deviceId=xxxxxx&pip=192.168.1.1&password=xxxxxx&deviceOS=14.3&deviceBrand=iphone&deviceModel=iPhone&remark4=&keyVersion=2&deviceCode=xxxxxx"
},
{
"data": "帐号2 信息"
}
],
"V2EX_COOKIE_LIST": [
{
"v2ex_cookie": "帐号1 cookie"
},
{
"v2ex_cookie": "帐号2 cookie"
}
],
"WWW2NZZ_COOKIE_LIST": [
{
"www2nzz_cookie": "帐号1 cookie"
},
{
"www2nzz_cookie": "帐号2 cookie"
}
],
"SMZDM_COOKIE_LIST": [
{
"smzdm_cookie": "账号1 cookie"
},
{
"smzdm_cookie": "账号2 cookie"
}
],
"MIMOTION_ACCOUNT_LIST": [
{
"mimotion_phone": "账号1",
"mimotion_password": "账号1 密码",
"mimotion_min_step": "账号1 最小步数",
"mimotion_max_step": "账号1 最大步数"
},
{
"mimotion_phone": "账号2",
"mimotion_password": "账号2 密码",
"mimotion_min_step": "账号2 最小步数",
"mimotion_max_step": "账号2 最大步数"
}
],
"ACFUN_ACCOUNT_LIST": [
{
"acfun_phone": "帐号1 手机号",
"acfun_password": "帐号1 密码"
},
{
"acfun_phone": "帐号2 手机号",
"acfun_password": "帐号2 密码"
}
],
"CLOUD189_ACCOUNT_LIST": [
{
"cloud189_phone": "帐号1 手机号",
"cloud189_password": "帐号1 密码"
},
{
"cloud189_phone": "帐号2 手机号",
"cloud189_password": "帐号2 密码"
}
],
"SAMSUNG_COOKIE_LIST": [
{
"samsung_cookie": "帐号1 cookie"
},
{
"samsung_cookie": "帐号2 cookie"
}
],
"WPS_COOKIE_LIST": [
{
"wps_cookie": "帐号1 cookie"
},
{
"wps_cookie": "帐号2 cookie"
}
],
"POJIE_COOKIE_LIST": [
{
"pojie_cookie": "帐号1 cookie"
},
{
"pojie_cookie": "帐号2 cookie"
}
]
}

View File

@ -6,5 +6,5 @@ services:
restart: always
tty: true
volumes:
- ./config.json:/dailycheckin/config.json
- ./config:/dailycheckin/config
- ./logs:/dailycheckin/logs

View File

@ -7,7 +7,7 @@ services:
tty: true
volumes:
- ./my_crontab_list.sh:/dailycheckin/docker/my_crontab_list.sh
- ./config.json:/dailycheckin/config.json
- ./config:/dailycheckin/config
- ./logs:/dailycheckin/logs
environment:
- CUSTOM_LIST_FILE=my_crontab_list.sh

View File

@ -7,7 +7,7 @@ services:
tty: true
volumes:
- ./my_crontab_list.sh:/dailycheckin/docker/my_crontab_list.sh
- ./config.json:/dailycheckin/config.json
- ./config:/dailycheckin/config
- ./logs:/dailycheckin/logs
environment:
- CUSTOM_LIST_FILE=my_crontab_list.sh

View File

@ -71,6 +71,4 @@ if [ $CUSTOM_LIST_FILE ]; then
chmod -R 777 $customListFile
fi
chmod -R 777 /dailycheckin/config.json
crond -f

View File

@ -30,16 +30,17 @@ sudo chmod +x /usr/local/bin/docker-compose
```text
dailycheckin
├── config.json
└── docker-compose.yml
|-- config
| `-- config.json
`-- docker-compose.yml
```
- dailycheckin/config.json: 配置文件
- dailycheckin/config/config.json: 配置文件
- dailycheckin/docker-compose.yml: docker启动文件
## 二、修改配置文件等
### dailycheckin/config.json
### dailycheckin/config/config.json
> 请务必到 [http://www.json.cn](http://www.json.cn) 网站检查 `config.json` 文件格式是否正确!
@ -60,7 +61,7 @@ services:
restart: always
tty: true
volumes:
- ./config.json:/dailycheckin/config.json
- ./config:/dailycheckin/config
- ./logs:/dailycheckin/logs
```
@ -92,7 +93,7 @@ docker exec dailycheckin python3 index.py xmly
1. 对于修改 `config.json` 文件发现为更改的情况
先执行 `docker-compose down` 停止并删除容器,再执行 `docker-compose up -d` 启动容器
先执行 `docker-compose down` 停止并删除容器,再执行 `docker-compose up -d` 启动容器
## 附录

View File

@ -13,10 +13,8 @@
参考[配置说明文档](https://sitoi.github.io/dailycheckin/settings/) GitHub Actions Secrets 环境变量
![Secret 教程](https://cdn.jsdelivr.net/gh/Sitoi/dailycheckin/docs/img/secret.png)
Secrets 填写教程,以 IQIYI_COOKIE_LIST 为例:
- name: 斜体加粗大写英文字母
@ -35,7 +33,6 @@ IQIYI_COOKIE_LIST
]
```
## 三、Star 一下,立即执行,观察运行情况
点一下自己 fork 项目的 star 立即执行

View File

@ -17,8 +17,10 @@ class FMAPPCheckIn:
code = response.get("code")
if code == "200":
data = response.get("data", {})
msg = f"在坚持{data.get('nextDay')}天即可获得{data.get('nextNumber')}个发米粒\n" \
f"签到{data.get('lastDay')}天可获得{data.get('lastNumber')}个发米粒"
msg = (
f"在坚持{data.get('nextDay')}天即可获得{data.get('nextNumber')}个发米粒\n"
f"签到{data.get('lastDay')}天可获得{data.get('lastNumber')}个发米粒"
)
else:
msg = response.get("message")
except Exception as e:
@ -65,16 +67,16 @@ class FMAPPCheckIn:
fmapp_cookie = fmapp_info.get("fmapp_cookie")
fmapp_device_id = fmapp_info.get("fmapp_device_id")
headers = {
'Host': 'fmapp.chinafamilymart.com.cn',
'Content-Type': 'application/json',
'Accept': '*/*',
'loginChannel': 'app',
'Accept-Language': 'zh-Hans-CN;q=1.0, en-CN;q=0.9, ja-CN;q=0.8, zh-Hant-HK;q=0.7, io-Latn-CN;q=0.6',
'token': fmapp_token,
'fmVersion': '2.0.0',
'deviceId': fmapp_device_id,
'User-Agent': 'Fa',
"cookie": fmapp_cookie
"Host": "fmapp.chinafamilymart.com.cn",
"Content-Type": "application/json",
"Accept": "*/*",
"loginChannel": "app",
"Accept-Language": "zh-Hans-CN;q=1.0, en-CN;q=0.9, ja-CN;q=0.8, zh-Hant-HK;q=0.7, io-Latn-CN;q=0.6",
"token": fmapp_token,
"fmVersion": "2.0.0",
"deviceId": fmapp_device_id,
"User-Agent": "Fa",
"cookie": fmapp_cookie,
}
sign_msg = self.sign(headers=headers)
name_msg = self.user_info(headers=headers)
@ -85,7 +87,9 @@ class FMAPPCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_fmapp_account_list = datas.get("FMAPP_ACCOUNT_LIST", [])
FMAPPCheckIn(fmapp_account_list=_fmapp_account_list).main()

View File

@ -15,6 +15,7 @@ from utils.message import (
message2server,
message2server_turbo,
message2telegram,
important_notice
)
@ -43,7 +44,7 @@ def main_handler(event, context):
else:
message = None
try:
with open(os.path.join(os.path.dirname(__file__), "config.json"), "r", encoding="utf-8") as f:
with open(os.path.join(os.path.dirname(__file__), "config/config.json"), "r", encoding="utf-8") as f:
data = json.loads(f.read())
dingtalk_secret = data.get("DINGTALK_SECRET")
dingtalk_access_token = data.get("DINGTALK_ACCESS_TOKEN")
@ -91,6 +92,9 @@ def main_handler(event, context):
print(e)
msg_list = []
content_list += msg_list
notice = important_notice()
if notice:
content_list.append(notice)
use_time_info = f"本次任务使用时间: {time.time() - start_time}"
content_list.append(use_time_info)
content = "\n-----------------------------\n\n".join(content_list)

View File

@ -174,16 +174,15 @@ class IQIYICheckIn:
self.query_user_task(p00001=p00001).join_task(p00001=p00001)
task_msg = self.query_user_task(p00001=p00001).get_task_rewards(p00001=p00001)
user_msg = self.user_information(p00001=p00001)
msg = (
f"【爱奇艺签到】\n{user_msg}\n"
f"签到奖励: {sign_msg}\n任务奖励: {task_msg}\n抽奖奖励: {draw_msg}"
)
msg = f"【爱奇艺签到】\n{user_msg}\n" f"签到奖励: {sign_msg}\n任务奖励: {task_msg}\n抽奖奖励: {draw_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:
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())
_iqiyi_cookie_list = datas.get("IQIYI_COOKIE_LIST", [])
IQIYICheckIn(iqiyi_cookie_list=_iqiyi_cookie_list).main()

View File

@ -89,11 +89,19 @@ class KGQQCheckIn:
print(e)
# VIP 签到
try:
getinfourl = "https://node.kg.qq.com/webapp/proxy?ns=proto_vip_webapp&cmd=vip.get_vip_info&t_uUid=" + t_uuid + "&t_uWebReq=1&t_uGetDataFromC4B=1"
getinfourl = (
"https://node.kg.qq.com/webapp/proxy?ns=proto_vip_webapp&cmd=vip.get_vip_info&t_uUid="
+ t_uuid
+ "&t_uWebReq=1&t_uGetDataFromC4B=1"
)
inforequest = requests.get(url=getinfourl, headers=headers)
vip_status = inforequest.json()["data"]["vip.get_vip_info"]["stVipCoreInfo"]["uStatus"]
if vip_status == 1:
vipurl = "https://node.kg.qq.com/webapp/proxy?t_uUid=" + t_uuid + "&ns=proto_vip_webapp&cmd=vip.get_vip_day_reward&ns_inbuf=&nocache=1613719349184&mapExt=JTdCJTIyY21kTmFtZSUyMiUzQSUyMkdldFZpcERheVJld2FyZCUyMiU3RA%3D%3D&g_tk_openkey=642424811"
vipurl = (
"https://node.kg.qq.com/webapp/proxy?t_uUid="
+ t_uuid
+ "&ns=proto_vip_webapp&cmd=vip.get_vip_day_reward&ns_inbuf=&nocache=1613719349184&mapExt=JTdCJTIyY21kTmFtZSUyMiUzQSUyMkdldFZpcERheVJld2FyZCUyMiU3RA%3D%3D&g_tk_openkey=642424811"
)
viprequest = requests.get(url=vipurl, headers=headers)
str_tips = viprequest.json()["data"]["vip.get_vip_day_reward"]["strTips"]
u_cur_reward_num = viprequest.json()["data"]["vip.get_vip_day_reward"]["uCurRewardNum"]
@ -121,7 +129,9 @@ class KGQQCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_kgqq_cookie_list = datas.get("KGQQ_COOKIE_LIST", [])
KGQQCheckIn(kgqq_cookie_list=_kgqq_cookie_list).main()

View File

@ -273,7 +273,9 @@ class LianTongCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_liantong_account_list = datas.get("LIANTONG_ACCOUNT_LIST", [])
LianTongCheckIn(liantong_account_list=_liantong_account_list).main()

View File

@ -101,7 +101,9 @@ class MiMotion:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_mimotion_account_list = datas.get("MIMOTION_ACCOUNT_LIST", [])
MiMotion(mimotion_account_list=_mimotion_account_list).main()

View File

@ -16,7 +16,7 @@ nav:
- 主页: index.md
- 配置: settings.md
- 教程:
- local.md
- docker.md
- github-actions.md
- tencent-scf.md
- local.md
- docker.md
- github-actions.md
- tencent-scf.md

View File

@ -24,7 +24,9 @@ class Motto:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
motto = datas.get("MOTTO")
if motto:

View File

@ -89,7 +89,7 @@ class Music163CheckIn:
url=resource_url,
data=self.protect('{"csrf_token":"' + requests.utils.dict_from_cookiejar(temp_cookie)["__csrf"] + '"}'),
headers=headers,
verify=False
verify=False,
)
res_data = json.loads(res.text, strict=False)
count = 0
@ -129,9 +129,7 @@ class Music163CheckIn:
break
postdata = {"logs": json.dumps(buffer)}
res = session.post(
url="http://music.163.com/weapi/feedback/weblog",
data=self.protect(json.dumps(postdata)),
verify=False
url="http://music.163.com/weapi/feedback/weblog", data=self.protect(json.dumps(postdata)), verify=False
)
res_data = json.loads(res.text, strict=False)
if res_data["code"] == 200:
@ -153,7 +151,9 @@ class Music163CheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_music163_account_list = datas.get("MUSIC163_ACCOUNT_LIST", [])
Music163CheckIn(music163_account_list=_music163_account_list).main()

View File

@ -31,10 +31,7 @@ class OnePlusBBSCheckIn:
formhash = re.findall(r"bbs_formhash=(.*?);", cookie)[0]
data = {"formhash": formhash, "qdxq": "kx", "qdmode": "1", "todaysay": "努力奋斗"}
response = requests.post(
url="https://www.oneplusbbs.com/plugin.php",
headers=headers,
params=params,
data=data
url="https://www.oneplusbbs.com/plugin.php", headers=headers, params=params, data=data
).text
msg = re.findall(r'<div class="c">(.*?)</div>', response, re.S)
msg = msg[0].strip() if msg else "Cookie 可能过期"
@ -103,7 +100,9 @@ class OnePlusBBSCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_oneplusbbs_cookie_list = datas.get("ONEPLUSBBS_COOKIE_LIST", [])
OnePlusBBSCheckIn(oneplusbbs_cookie_list=_oneplusbbs_cookie_list).main()

View File

@ -15,8 +15,8 @@ class PojieCheckIn:
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)
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 失效"
@ -36,9 +36,9 @@ class PojieCheckIn:
for pojie_cookie in self.pojie_cookie_list:
pojie_cookie = pojie_cookie.get("pojie_cookie")
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36',
'Cookie': pojie_cookie,
'ContentType': 'text/html;charset=gbk'
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36",
"Cookie": pojie_cookie,
"ContentType": "text/html;charset=gbk",
}
uid = re.findall(r"htVD_2132_lastcheckfeed=(.*?);", pojie_cookie)[0].split("%7C")[0]
sign_msg = self.sign(headers=headers)
@ -48,7 +48,9 @@ class PojieCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_pojie_cookie_list = datas.get("POJIE_COOKIE_LIST", [])
PojieCheckIn(pojie_cookie_list=_pojie_cookie_list).main()

View File

@ -59,7 +59,9 @@ class SamsungCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_samsung_cookie_list = datas.get("SAMSUNG_COOKIE_LIST", [])
SamsungCheckIn(samsung_cookie_list=_samsung_cookie_list).main()

View File

@ -64,7 +64,9 @@ class SmzdmCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_smzdm_cookie_list = datas.get("SMZDM_COOKIE_LIST", [])
SmzdmCheckIn(smzdm_cookie_list=_smzdm_cookie_list).main()

View File

@ -99,7 +99,9 @@ class TiebaCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_tieba_cookie_list = datas.get("TIEBA_COOKIE_LIST", [])
TiebaCheckIn(tieba_cookie_list=_tieba_cookie_list).main()

View File

@ -47,7 +47,7 @@ checkin_map = {
"WPS_COOKIE_LIST": WPSCheckIn,
"POJIE_COOKIE_LIST": PojieCheckIn,
"CITY_NAME_LIST": Weather,
"XMLY_COOKIE_LIST": XMLYCheckIn
"XMLY_COOKIE_LIST": XMLYCheckIn,
}

View File

@ -75,6 +75,23 @@ def message2bark(bark_url: str, content):
if not bark_url.endswith("/"):
bark_url += "/"
url = f"{bark_url}{content}"
headers = {'Content-type': "application/x-www-form-urlencoded"}
headers = {"Content-type": "application/x-www-form-urlencoded"}
requests.get(url=url, headers=headers)
return
def important_notice():
datas = requests.get(url="https://api.github.com/repos/Sitoi/dailycheckin/issues?state=open&labels=通知").json()
if datas:
data = datas[0]
title = data.get("title")
body = data.get("body")
url = data.get("url")
notice = f"重要通知: {title}\n通知内容: {body}\n详细地址: {url}"
else:
notice = None
return notice
if __name__ == '__main__':
print(important_notice())

View File

@ -67,7 +67,9 @@ class V2exCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_v2ex_cookie_list = datas.get("V2EX_COOKIE_LIST", [])
V2exCheckIn(v2ex_cookie_list=_v2ex_cookie_list).main()

View File

@ -55,7 +55,9 @@ class VQQCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_vqq_cookie_list = datas.get("VQQ_COOKIE_LIST", [])
VQQCheckIn(vqq_cookie_list=_vqq_cookie_list).main()

View File

@ -38,7 +38,9 @@ class Weather:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_city_name_list = datas.get("CITY_NAME_LIST")
Weather(city_name_list=_city_name_list).main()

View File

@ -333,7 +333,9 @@ class WPSCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_wps_cookie_list = datas.get("WPS_COOKIE_LIST", [])
WPSCheckIn(wps_cookie_list=_wps_cookie_list).main()

View File

@ -63,7 +63,9 @@ class WWW2nzzCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_www2nzz_cookie_list = datas.get("WWW2NZZ_COOKIE_LIST", [])
WWW2nzzCheckIn(www2nzz_cookie_list=_www2nzz_cookie_list).main()

View File

@ -727,7 +727,7 @@ class XMLYCheckIn:
"ballKey": str(uid),
"currentTimeMillis": str(currenttimemillis),
"sawVideoSignature": f"{currenttimemillis}+{uid}",
"version": "2"
"version": "2",
}
try:
response = requests.get(
@ -755,10 +755,7 @@ class XMLYCheckIn:
"Connection": "keep-alive",
}
params = {
"activtyId": "indexSegAward",
"awardReceiveId": award_receive_id
}
params = {"activtyId": "indexSegAward", "awardReceiveId": award_receive_id}
try:
response = requests.get(
url="http://mobile.ximalaya.com/pizza-category/activity/awardMultiple",
@ -832,8 +829,10 @@ class XMLYCheckIn:
}
try:
response = requests.post(
url="https://m.ximalaya.com/speed/web-earn/card/draw", headers=headers, cookies=cookies,
data=json.dumps(data)
url="https://m.ximalaya.com/speed/web-earn/card/draw",
headers=headers,
cookies=cookies,
data=json.dumps(data),
)
except Exception as e:
print(f"网络请求异常: {e}")
@ -912,9 +911,7 @@ class XMLYCheckIn:
self.card_exchange_card(cookies, theme_id, tmp_record_id)
# 万能卡兑换稀有卡
response = requests.get(
url="https://m.ximalaya.com/speed/web-earn/card/userCardInfo",
headers=headers,
cookies=cookies
url="https://m.ximalaya.com/speed/web-earn/card/userCardInfo", headers=headers, cookies=cookies
)
data = response.json()["data"]
user_cards_list = data["userCardsList"]
@ -989,16 +986,20 @@ class XMLYCheckIn:
print("*" * 10, "首页、宝箱奖励及翻倍", "*" * 10)
index_baoxiang_award_msg = self.index_baoxiang_award(cookies) # 首页、宝箱奖励及翻倍
total, today_total, history_total = self.account(cookies)
msg = f"【喜马拉雅极速版签到】\n北京时间: {utc_time}\n设备信息: {device_model}\n连续签到: {continuous_days}\n收听时长: {listen_msg}分钟\n" \
f"金币气泡: {bubble_msg}\n答题奖励: {answer_msg}\n卡牌奖励: {card_report_time_msg}\n" \
f"{card_msg}\n{index_baoxiang_award_msg}\n" \
f"当前剩余: {total}\n今日获得: {today_total}\n累计获得: {history_total}"
msg = (
f"【喜马拉雅极速版签到】\n北京时间: {utc_time}\n设备信息: {device_model}\n连续签到: {continuous_days}\n收听时长: {listen_msg}分钟\n"
f"金币气泡: {bubble_msg}\n答题奖励: {answer_msg}\n卡牌奖励: {card_report_time_msg}\n"
f"{card_msg}\n{index_baoxiang_award_msg}\n"
f"当前剩余: {total}\n今日获得: {today_total}\n累计获得: {history_total}"
)
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:
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())
_xmly_cookie_list = datas.get("XMLY_COOKIE_LIST")
XMLYCheckIn(xmly_cookie_list=_xmly_cookie_list).main()

View File

@ -49,7 +49,9 @@ class YouDaoCheckIn:
if __name__ == "__main__":
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), "config.json"), "r", encoding="utf-8") as f:
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())
_youdao_cookie_list = datas.get("YOUDAO_COOKIE_LIST", [])
YouDaoCheckIn(youdao_cookie_list=_youdao_cookie_list).main()