Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复心跳跨日导致错误 #211

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cyb233
Copy link
Contributor

@cyb233 cyb233 commented Dec 6, 2024

fix #205
由于发送请求携带的60秒前的时间戳是位于之前一天导致的

需要注意

由于修复此问题后,当粉丝牌数量较多导致单次运行会超过一天/24小时后,不会在0点因报错而结束并推送。为避免影响后续运行,建议考虑额外增加指定时间停止的方案和参数,其中参数可考虑同时支持 HH:mm:ss 格式和 格式

STOPTIME: 00:00:00 # HH:mm:ss
# 或
STOPTIME: 86400 # 秒

已支持停止观看直播的配置 c15d6ce

@cyb233
Copy link
Contributor Author

cyb233 commented Dec 7, 2024

运行到第二天接口又返回了time check failed,真是奇怪,再排查排查

@cyb233
Copy link
Contributor Author

cyb233 commented Dec 12, 2024

似乎有可能是watch_time误差过大导致的,使用计算结果吧

- 在配置中增加 STOPWATCHINGTIME 选项,支持设置停止直播的时间
- 支持 HH:mm:ss 格式和秒格式的停止时间设置
- 到达设定时间后,自动停止直播任务并结束进程
- 优化了配置文件读取逻辑,增加了对新配置项的处理
@cyb233
Copy link
Contributor Author

cyb233 commented Dec 13, 2024

已支持停止观看直播的功能

@mhcms
Copy link

mhcms commented Jan 7, 2025

log.info(f"本轮任务将在 {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(config["STOPWATCHINGTIME"]))} 结束")

f-string内记得使用单引号 ' 来避免冲突

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: 跨日时抛出异常 BiliApiError: bad timestamp request
2 participants