Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Commit

Permalink
chore: 提示
Browse files Browse the repository at this point in the history
  • Loading branch information
chen310 committed Feb 18, 2022
1 parent 40d59bd commit 759a424
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@

> 开发不易,如果你觉得本项目对你有用,可以点个 star,也可以到底部给个[赞赏](#赞赏)
## 注意事项

- 提 issue 之前看看是否有重复的 issue。
- 不要直接在 GitHub 上修改配置文件。已经修改了的,尽快覆盖,并修改密码。
- 转载请注明出处,并保留原作者信息。
- 禁止将代码用于商业用途,包括打包售卖,收费代挂等。
- 为了账号安全考虑,请勿将账号密码交给他人代挂。

## 一、部署到腾讯云函数

### 开通服务
Expand Down Expand Up @@ -563,9 +571,6 @@ docker run -itd --restart=on-failure \

<p align="left">支付宝</p> <img width="300" height="300" src="https://cdn.jsdelivr.net/gh/chen310/NeteaseCloudMusicTasks/public/img/alipay.png" />

<p align="left">支付宝领红包</p> <img width="300" height="300" src="https://cdn.jsdelivr.net/gh/chen310/NeteaseCloudMusicTasks/public/img/alipayhb.png" />

<p align="left">饿了么领红包</p> <img width="300" height="300" src="https://cdn.jsdelivr.net/gh/chen310/NeteaseCloudMusicTasks/public/img/eleme.png" />

### star 数

Expand All @@ -574,6 +579,7 @@ docker run -itd --restart=on-failure \
### 声明

- 本仓库中的脚本仅用于测试和学习目的,请勿用于商业或非法目的,否则后果自负
- 转载请注明出处,并保留原作者信息。
- 如果您认为该项目的脚本可能涉嫌侵犯您的权利,请及时通知,我们将在确认后及时删除

### 灵感来源
Expand Down
26 changes: 15 additions & 11 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ def md2text(data):

def getSongNumber():
res = {}
if "SONG_NUMBER" in os.environ:
sp1 = os.environ.get("SONG_NUMBER").split("#")
if len(sp1) != 2:
return res
if sp1[0] != time.strftime("%Y-%m-%d", time.gmtime(time.time()+28800)):
print("环境变量 SONG_NUMBER 已过期")
return res
for number in sp1[1].split(";"):
sp2 = number.split(":")
if len(sp2) == 2:
res[sp2[0]] = int(sp2[1])
if runtime == 'tencent-scf':
if "SONG_NUMBER" in os.environ:
sp1 = os.environ.get("SONG_NUMBER").split("#")
if len(sp1) != 2:
return res
if sp1[0] != time.strftime("%Y-%m-%d", time.gmtime(time.time()+28800)):
print("环境变量 SONG_NUMBER 已过期。是否未开启定时触发器 timer-songnumber")
return res
for number in sp1[1].split(";"):
sp2 = number.split(":")
if len(sp2) == 2:
res[sp2[0]] = int(sp2[1])
else:
print(
"环境变量 SONG_NUMBER 不存在。项目地址: https://github.com/chen310/NeteaseCloudMusicTasks")
return res


Expand Down
Binary file removed public/img/alipayhb.png
Binary file not shown.
Binary file removed public/img/eleme.png
Binary file not shown.
3 changes: 3 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def jsonDumps(data):


def append_environ(vars):
if 'TENCENT_SECRET_ID' not in os.environ or 'TENCENT_SECRET_KEY' not in os.environ:
print('环境变量 TENCENT_SECRET_ID 或 TENCENT_SECRET_KEY 不存在。项目地址: https://github.com/chen310/NeteaseCloudMusicTasks')
return False
kv = {}
keylist = ["TENCENT_SECRET_ID", "TENCENT_SECRET_KEY", "SONG_NUMBER"]
for key in os.environ:
Expand Down

0 comments on commit 759a424

Please sign in to comment.