Compare commits

...

11 Commits

Author SHA1 Message Date
kevinBobo
3337a270cb
Merge 691bd89494 into 556783581a 2024-03-07 08:46:04 +00:00
hanyabo
691bd89494 微信反向代理参数说明完善 2024-03-07 16:45:21 +08:00
shitao
556783581a ⬆️ 更新(__version__.py):将版本号从24.2.27升级到24.3.7 2024-03-07 15:14:46 +08:00
shitao
495bc9e026 📝 更新(docs): 添加新的版本历史记录2024-03-07
 功能(docs): 在README和index中添加Python版本和下载数量的徽章
  🐛 修复(docs): 在Bark通知设置文档中添加消息长度限制的警告
  ♻️ 重构(docs): 更新主题配置中的banner信息为最新版本
  🚀 部署(docs): 更新aliyun设置文档的格式
2024-03-07 15:10:40 +08:00
shitao
5fa538e640 ⬆️ 升级(setup.py):将Python的最低版本要求从3.6.0升级到3.9.0
 功能(setup.py):添加对Python 3.10的支持
2024-03-07 14:52:19 +08:00
shitao
72729dade8 ♻️ 重构(imaotai_login.py):简化了获取位置输入的代码行 2024-03-07 14:52:03 +08:00
shitao
88edcba09c ♻️ 重构(main.py):使用Python的海象运算符简化了normal_reward的赋值和检查 2024-03-07 14:51:52 +08:00
shitao
882289fbaf ♻️ 重构(message.py):将urllib.parse模块的导入方式改为从urllib.parse中导入quote_plus
 功能(message.py):在message2bark函数中添加对content的quote_plus处理
2024-03-07 14:51:30 +08:00
shitao
44081f6e45 ♻️ 重构(iqiyi/main.py):简化msg和return的代码结构,提高代码的可读性 2024-03-07 14:50:36 +08:00
shitao
3cb28a3471 🔧 更新(.pre-commit-config.yaml):移除了对ruff-pre-commit库的依赖 2024-03-07 14:50:00 +08:00
hanyabo
2455ab8765 修改微信通知文档 2024-03-07 14:45:31 +08:00
15 changed files with 55 additions and 50 deletions

View File

@ -44,12 +44,6 @@ repos:
- id: isort
args: ['--profile', 'black', '--filter-files']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.13
hooks:
- id: ruff
args: ['--fix', '--ignore', 'E722']
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:

View File

@ -17,10 +17,11 @@
[![][github-issues-shield]][github-issues-link]
[![][github-contributors-shield]][github-contributors-link]
[![][python-version-shield]][python-version-link]
[![][pypi-dm-shield]][pypi-dm-link]
[![][docker-pull-shield]][docker-pull-link]
[![][docker-size-shield]][docker-size-link]
[![][docker-stars-shield]][docker-stars-link]
[![][pypi-dm-shield]][pypi-dm-link]
[![][github-license-shield]][github-license-link]
<!-- SHIELD GROUP -->
@ -94,10 +95,12 @@
## 📝 License
This project is [MIT](./LICENSE) licensed.
Copyright © 2021 [Sitoi][profile-link]. <br />
This project is [MIT](https://github.com/Sitoi/dailycheckin/blob/main/LICENSE) licensed.
<!-- LINK GROUP -->
[profile-link]: https://github.com/sitoi
[github-codespace-link]: https://codespaces.new/sitoi/dailycheckin
[github-codespace-shield]: https://github.com/sitoi/dailycheckin/blob/main/images/codespaces.png?raw=true
[github-contributors-link]: https://github.com/sitoi/dailycheckin/graphs/contributors
@ -126,7 +129,9 @@ This project is [MIT](./LICENSE) licensed.
[docker-stars-link]: https://hub.docker.com/repository/docker/sitoi/dailycheckin
[pypi-dm-shield]: https://img.shields.io/pypi/dm/dailycheckin?label=pypi&labelColor=black&style=flat-square
[pypi-dm-link]: https://pypi.org/project/dailycheckin/
[python-version-link]: https://pypi.org/project/dailycheckin/
[python-version-shield]: https://img.shields.io/pypi/pyversions/dailycheckin?labelColor=black&style=flat-square
[pypi-version-shield]: https://img.shields.io/pypi/v/dailycheckin?labelColor=black&style=flat-square
[pypi-version-link]: https://pypi.org/project/dailycheckin/
[starchart-shield]: https://starchart.cc/Sitoi/dailycheckin.svg
[starchart-link]: https://starchart.cc/Sitoi/dailycheckin
[starchart-shield]: https://api.star-history.com/svg?repos=sitoi/dailycheckin&type=Date
[starchart-link]: https://star-history.com/#sitoi/dailycheckin&Date

View File

@ -1 +1 @@
__version__ = "24.2.27"
__version__ = "24.3.7"

View File

@ -106,9 +106,7 @@ class IQIYI(CheckIn):
msg = [{"name": "签到天数", "value": _msg}]
else:
try:
msg = [
{"name": "签到天数", "value": res["data"]["data"]["signDays"]}
]
msg = [{"name": "签到天数", "value": res["data"]["data"]["signDays"]}]
except Exception as e:
msg = [{"name": "签到天数", "value": str(e)}]
else:
@ -265,12 +263,7 @@ class IQIYI(CheckIn):
url="https://act.vip.iqiyi.com/level-right/receive", data=data
).json()
msg = res["msg"]
return [
{
"name": "V7 免费升级星钻",
"value": msg,
}
]
return [{"name": "V7 免费升级星钻", "value": msg}]
def start_watch(self, p00001, p00003, dfp):
total_time = self.get_watch_time(p00001=p00001)

View File

@ -67,9 +67,8 @@ class SMZDM(CheckIn):
url2 = "https://user-api.smzdm.com/checkin/all_reward"
resp = requests.post(url=url2, headers=headers, data=data)
result = resp.json()
normal_reward = result["data"]["normal_reward"]
msgs = []
if normal_reward:
if normal_reward := result["data"]["normal_reward"]:
msgs = [
{
"name": "签到奖励",

View File

@ -3,7 +3,7 @@ import hashlib
import hmac
import json
import time
import urllib.parse
from urllib.parse import quote_plus
import requests
@ -90,7 +90,7 @@ def message2dingtalk(dingtalk_secret, dingtalk_access_token, content):
hmac_code = hmac.new(
secret_enc, string_to_sign_enc, digestmod=hashlib.sha256
).digest()
sign = urllib.parse.quote_plus(base64.b64encode(hmac_code))
sign = quote_plus(base64.b64encode(hmac_code))
send_data = {"msgtype": "text", "text": {"content": content}}
requests.post(
url="https://oapi.dingtalk.com/robot/send?access_token={}&timestamp={}&sign={}".format(
@ -106,6 +106,7 @@ def message2bark(bark_url: str, content):
print("Bark 推送开始")
if not bark_url.endswith("/"):
bark_url += "/"
content = quote_plus(content)
url = f"{bark_url}{content}"
headers = {"Content-type": "application/x-www-form-urlencoded"}
requests.get(url=url, headers=headers)
@ -125,8 +126,11 @@ def message2qywxapp(
qywx_corpid, qywx_agentid, qywx_corpsecret, qywx_touser, qywx_media_id, qywx_origin, content
):
print("企业微信应用消息推送开始")
bastUrl = "https://qyapi.weixin.qq.com"
if qywx_origin:
bastUrl = qywx_origin;
res = requests.get(
f"https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
f"{bastUrl}/cgi-bin/gettoken?corpid={qywx_corpid}&corpsecret={qywx_corpsecret}"
)
token = res.json().get("access_token", False)
if qywx_media_id:
@ -159,16 +163,10 @@ def message2qywxapp(
"btntxt": "开源项目",
},
}
if qywx_origin:
requests.post(
url=f"{qywx_origin}/cgi-bin/message/send?access_token={token}",
data=json.dumps(data),
)
else:
requests.post(
url=f"https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={token}",
data=json.dumps(data),
)
requests.post(
url=f"{bastUrl}/cgi-bin/message/send?access_token={token}",
data=json.dumps(data),
)
return

View File

@ -0,0 +1,7 @@
# 2024-03-07
![PyPI](https://img.shields.io/badge/Pypi-v24.3.7-brightgreen)
## 🐛 修复
- 修复「Bark」消息不通知的 BUG

View File

@ -1,4 +1,5 @@
{
"2024-03-07": "2024-03-07",
"2024-02-27": "2024-02-27",
"2024-02-22": "2024-02-22",
"2024-02-20": "2024-02-20",

View File

@ -23,10 +23,11 @@
[![][github-issues-shield]][github-issues-link]
[![][github-contributors-shield]][github-contributors-link]
[![][python-version-shield]][python-version-link]
[![][pypi-dm-shield]][pypi-dm-link]
[![][docker-pull-shield]][docker-pull-link]
[![][docker-size-shield]][docker-size-link]
[![][docker-stars-shield]][docker-stars-link]
[![][pypi-dm-shield]][pypi-dm-link]
[![][github-license-shield]][github-license-link]
<!-- SHIELD GROUP -->
@ -100,10 +101,12 @@
## 📝 License
This project is [MIT](./LICENSE) licensed.
Copyright © 2021 [Sitoi][profile-link]. <br />
This project is [MIT](https://github.com/Sitoi/dailycheckin/blob/main/LICENSE) licensed.
<!-- LINK GROUP -->
[profile-link]: https://github.com/sitoi
[github-codespace-link]: https://codespaces.new/sitoi/dailycheckin
[github-codespace-shield]: https://github.com/sitoi/dailycheckin/blob/main/images/codespaces.png?raw=true
[github-contributors-link]: https://github.com/sitoi/dailycheckin/graphs/contributors
@ -132,7 +135,9 @@ This project is [MIT](./LICENSE) licensed.
[docker-stars-link]: https://hub.docker.com/repository/docker/sitoi/dailycheckin
[pypi-dm-shield]: https://img.shields.io/pypi/dm/dailycheckin?label=pypi&labelColor=black&style=flat-square
[pypi-dm-link]: https://pypi.org/project/dailycheckin/
[python-version-link]: https://pypi.org/project/dailycheckin/
[python-version-shield]: https://img.shields.io/pypi/pyversions/dailycheckin?labelColor=black&style=flat-square
[pypi-version-shield]: https://img.shields.io/pypi/v/dailycheckin?labelColor=black&style=flat-square
[pypi-version-link]: https://pypi.org/project/dailycheckin/
[starchart-shield]: https://starchart.cc/Sitoi/dailycheckin.svg
[starchart-link]: https://starchart.cc/Sitoi/dailycheckin
[starchart-shield]: https://api.star-history.com/svg?repos=sitoi/dailycheckin&type=Date
[starchart-link]: https://star-history.com/#sitoi/dailycheckin&Date

View File

@ -87,8 +87,9 @@ import { Steps } from 'nextra/components'
## 获取方式
<Steps>
### 打开官网
进入[阿里云盘](https://www.aliyundrive.com/drive/)
### 打开开发者工具

View File

@ -1,4 +1,5 @@
import { Cards, Card } from 'nextra/components'
import { Callout } from 'nextra/components'
<Cards>
<Card
@ -49,6 +50,10 @@ import { Cards, Card } from 'nextra/components'
# BARK
<Callout type="warning">
通知消息在 Bark 有长度限制,如果没收到推送,请将 MERGE_PUSH 改为 false
</Callout>
### 配置示例
```json filename="config.json" copy

View File

@ -70,4 +70,5 @@ import { Cards, Card } from 'nextra/components'
| _**QYWX_CORPSECRET**_ | corpsecret |
| _**QYWX_TOUSER**_ | touser |
| _**QYWX_MEDIA_ID**_ | media_id |
| _**QYWX_ORIGIN**_ | 企业微信反向代理地址 https://qyapi.weixin.qq.com/cgi-bin/gettoken将其中的https://qyapi.weixin.qq.com替换为**QYWX_ORIGIN** |
| _**MERGE_PUSH**_ | **true**: 将推送消息合并;**false**: 分开推送 |

View File

@ -72,13 +72,13 @@ const config: DocsThemeConfig = {
}
},
banner: {
key: '2024.2.27-release',
key: '2024.3.7-release',
text: (
<a
href="/dailycheckin/history/2024-02-27/"
href="/dailycheckin/history/2024-03-07/"
target="_blank"
>
🎉 DailyCheckIn 2024.2.27 is released. Read more
🎉 DailyCheckIn 2024.3.7 is released. Read more
</a>
),
},

View File

@ -127,9 +127,7 @@ def login(mobile: str, v_code: str):
def get_location():
while 1:
location = input(
"请输入精确小区位置,例如[小区名称],为你自动预约附近的门店:"
).strip()
location = input("请输入精确小区位置,例如[小区名称],为你自动预约附近的门店:").strip()
selects = select_geo(location)
a = 0

View File

@ -7,7 +7,7 @@ FOLDER = "dailycheckin"
DESCRIPTION = "dailycheckin"
EMAIL = "133397418@qq.com"
AUTHOR = "Sitoi"
REQUIRES_PYTHON = ">=3.6.0"
REQUIRES_PYTHON = ">=3.9.0"
VERSION = None
@ -73,10 +73,8 @@ setup(
entry_points={"console_scripts": ["dailycheckin = dailycheckin.main:checkin"]},
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],