forked from specialpointcentral/ucas-covid19
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bugfix: 使用environ传递口令,解决密码中包含特殊字符导致sed出错的问题
- Loading branch information
1 parent
df2d37a
commit efe7ef3
Showing
2 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,27 @@ | |
mail: [email protected] | ||
license: CC BY-NC-SA 3.0 | ||
""" | ||
|
||
import os | ||
import pytz | ||
import requests | ||
from time import sleep | ||
from random import randint | ||
from datetime import datetime | ||
|
||
user = "USERNAME" # sep账号 | ||
passwd = "PASSWORD" # sep密码 | ||
api_key = "API_KEY" # server酱的api,填了可以微信通知打卡结果,不填没影响 | ||
|
||
# 开启debug将会输出打卡填报的数据,关闭debug只会输出打卡成功或者失败,如果使用github actions,请务必设置该选项为False | ||
debug = False | ||
|
||
# 全局变量 | ||
user = "USERNAME" | ||
passwd = "PASSWORD" | ||
api_key = "API_KEY" | ||
|
||
# 如果检测到程序在 github actions 内运行,那么读取环境变量中的登录信息 | ||
if os.environ.get('GITHUB_RUN_ID', None): | ||
user = os.environ['SEP_USER_NAME'] # sep账号 | ||
passwd = os.environ['SEP_PASSWORD'] # sep密码 | ||
api_key = os.environ['API_KEY'] # server酱的api,填了可以微信通知打卡结果,不填没影响 | ||
|
||
|
||
def login(s: requests.Session, username, password): | ||
# r = s.get( | ||
|