Commit 660cd08 1 parent 4d5545a commit 660cd08 Copy full SHA for 660cd08
File tree 4 files changed +82
-12
lines changed
4 files changed +82
-12
lines changed Original file line number Diff line number Diff line change 1
- ## FF14 AutoSignRemake
1
+ # FF14 AutoSignRemake
2
2
3
- ##### 使用说明
3
+ ## 使用说明
4
4
5
5
** 按需下载Releases下的文件,进入项目根目录,使用 ``` pip -r requirements.txt ``` 安装依赖库**
6
6
7
- ##### 注意事项
7
+ ## 注意事项
8
8
9
9
** 一般情况下无需修改根目录下的设置文件 **
10
10
11
11
** 如果出现报错请开启 ``` DebugMode ``` 并将``` LogsLevel ``` 调整至 ``` High ``` 并心中默念「给我日志给我日志」然后再次执行程序将程序根目录出现的新东西发送到issue** .
12
12
13
13
** 没有logs文件无异于闭眼开车**
14
14
15
- ##### TodoList
15
+ ## TodoList
16
16
17
- ** 支持TeleBot/钉钉bot/等推送**
17
+ - [ ] 支持TeleBot/钉钉bot/等推送
18
+ - [ ] 支持账号密码和一键登录
19
+ - [ ] 支持青龙面板
18
20
19
- ** 支持账号密码和一键登录**
20
-
21
- ** 支持青龙面板**
22
-
23
- ##### 感谢
21
+ ## 感谢
24
22
25
23
[ @renchangjiu ] ( https://github.com/renchangjiu/FF14AutoSignIn ) ** 提供的核心思路**
26
24
27
- ##### License
25
+ ## License
28
26
29
- [ With AFL - 3.0] ( https://github.com/AmarokIce/PineappleDelight/blob/master/LICENSE )
27
+ [ With AFL - 3.0] ( https://github.com/AmarokIce/PineappleDelight/blob/master/LICENSE )
30
28
[ Pineapple LICENSE] ( https://github.com/AmarokIce/PineappleDelight/blob/master/LICENSE.txt )
Original file line number Diff line number Diff line change
1
+ import configparser
2
+
3
+ import requests
4
+
5
+
6
+ def send (title : str , content : str ):
7
+ """
8
+ 发送 bark 通知
9
+ :param title: 通知标题
10
+ :param content: 通知内容
11
+ :return: {'status': 'success'} 或 {'status': 'failed'}
12
+ """
13
+ config = configparser .ConfigParser ()
14
+ config .read ('config.ini' ,encoding = 'UTF-8' )
15
+ pushkey = config .get ('Notification' , 'push-key' )
16
+ url = 'https://api.day.app/' + pushkey
17
+ headers = {
18
+ "Content-Type" : "application/json" ,
19
+ "charset" : "UTF-8"
20
+ }
21
+ # bark通知将被分组到“FF14”,并且会自动保存
22
+ load = {
23
+ "title" : title ,
24
+ "body" : content ,
25
+ "badge" : 1 ,
26
+ "sound" : "minuet.caf" ,
27
+ "icon" : "https://huiji-thumb.huijistatic.com/ff14/uploads/thumb/3/33/000030.png/30px-000030.png" ,
28
+ "group" : "FF14" ,
29
+ "isArchive" : 1 ,
30
+ }
31
+ response = requests .post (url , headers = headers , json = load )
32
+ print (response .text )
33
+ if response .status_code == 200 :
34
+ return {'status' : 'success' }
35
+ else :
36
+ return {'status' : 'failed' }
Original file line number Diff line number Diff line change
1
+ import configparser
2
+ import importlib
3
+
4
+
5
+ def push (title , content ):
6
+ """
7
+ PushDeer推送
8
+ :param title: 通知标题
9
+ :param content: 通知内容
10
+ :return: 推送结果,如:{'status': 'success'} 或 {'status': 'failed'}
11
+ """
12
+
13
+ push_config = configparser .ConfigParser ()
14
+ push_config .read ('config.ini' , encoding = 'UTF-8' )
15
+ # 根据配置导入对应的包
16
+ push_module = importlib .import_module (push_config .get ('Notification' , 'ush-method' ))
17
+ result = push_module .push (title , content )
18
+ return result
Original file line number Diff line number Diff line change @@ -9,6 +9,24 @@ PushKey = 0
9
9
CookieSaved = False
10
10
CookieForceUpdated = 7
11
11
12
+
13
+ [Notification]
14
+ ; 若要启用消息通知,请将noc-enable设置为True,并根据说明正确配置push-key
15
+ noc-enable = False
16
+ ; 通知服务商可选:bark、pushdeer serverchan smtp
17
+ push-method = bark
18
+ ; 推送密钥或目标地址
19
+ push-key = xxxxx
20
+
21
+ ; SMTP 发件服务器配置
22
+ ; 目前仅支持SSL 465端口发送
23
+ ; TODO: 支持非SSL
24
+ smtp-host = " "
25
+ smtp-port = 465
26
+ smtp-username = " "
27
+ smtp-password = " "
28
+ smtp-ssl = True
29
+
12
30
[Develop]
13
31
Update = True
14
32
DebugMode = False
You can’t perform that action at this time.
0 commit comments