update(README.md)

This commit is contained in:
mei
2025-10-06 22:21:03 +08:00
parent 3d326d5357
commit 93ffced38e
6 changed files with 21 additions and 6 deletions
+12
View File
@@ -49,3 +49,15 @@
"bili_warn_address": "" // 哔哩哔哩cookie过期发送告警的邮件地址 "bili_warn_address": "" // 哔哩哔哩cookie过期发送告警的邮件地址
} }
``` ```
## 运行
```bash
go build
./goodBaby
```
之后在日志中找到 Bilibili 的登陆二维码,打开Bilibili APP 扫码登陆
> [!NOTE]
> 只有在登陆 Bilibili 后程序才会正常运行
+1 -1
View File
@@ -107,7 +107,7 @@ func LoadCookies(client *bilibili.Client) bool {
return true return true
} }
// 发送死亡通告 // 在Bilibili动态发送死亡通告
func SendBili(biliClient *bilibili.Client) { func SendBili(biliClient *bilibili.Client) {
config, err := configs.GetConfig() config, err := configs.GetConfig()
if err != nil { if err != nil {
+1
View File
@@ -8,6 +8,7 @@ import (
"github.com/ssdomei232/goodBaby/pkg" "github.com/ssdomei232/goodBaby/pkg"
) )
// 将repos设置为public
func Github() { func Github() {
config, err := configs.GetConfig() config, err := configs.GetConfig()
if err != nil { if err != nil {
+1
View File
@@ -14,6 +14,7 @@ const (
retryDelay = 10 * time.Second retryDelay = 10 * time.Second
) )
// 向邮件列表发送死亡通告
func SendMail() { func SendMail() {
config, err := configs.GetConfig() config, err := configs.GetConfig()
if err != nil { if err != nil {
+1
View File
@@ -12,6 +12,7 @@ import (
"github.com/ssdomei232/goodBaby/configs" "github.com/ssdomei232/goodBaby/configs"
) )
// 在QQ发送死亡通告
func SendQQ() { func SendQQ() {
config, err := configs.GetConfig() config, err := configs.GetConfig()
if err != nil { if err != nil {
+5 -5
View File
@@ -27,16 +27,16 @@ func init() {
duration = time.Duration(config.DisconnectDuration) * time.Hour duration = time.Duration(config.DisconnectDuration) * time.Hour
} }
// 初始化bilibili客户端
biliClient = bilibili.New()
initBilibili()
startCookieChecker() // 启动定期检查cookie有效性
timer = time.NewTimer(duration) timer = time.NewTimer(duration)
go func() { go func() {
<-timer.C <-timer.C
trigger(config) trigger(config)
}() }()
// 初始化bilibili客户端
biliClient = bilibili.New()
initBilibili()
startCookieChecker() // 启动定期检查cookie有效性
} }
func trigger(config configs.Config) { func trigger(config configs.Config) {