mirror of
https://github.com/ihmily/StreamCap.git
synced 2026-06-03 04:20:29 +08:00
feat: add live info check error status
This commit is contained in:
@@ -169,6 +169,10 @@ class RecordingManager:
|
||||
|
||||
async def check_if_live(self, recording: Recording):
|
||||
"""Check if the live stream is available, fetch stream data and update is_live status."""
|
||||
|
||||
if recording.recording:
|
||||
return
|
||||
|
||||
if not recording.monitor_status:
|
||||
recording.display_title = f"[{self._['monitor_stopped']}] {recording.title}"
|
||||
recording.status_info = RecordingStatus.STOPPED_MONITORING
|
||||
@@ -217,6 +221,7 @@ class RecordingManager:
|
||||
if not stream_info or not stream_info.anchor_name:
|
||||
logger.error(f"Fetch stream data failed: {recording.url}")
|
||||
recording.is_checking = False
|
||||
recording.status_info = RecordingStatus.LIVE_STATUS_CHECK_ERROR
|
||||
return
|
||||
|
||||
if self.settings.user_config.get("remove_emojis"):
|
||||
@@ -337,4 +342,4 @@ class RecordingManager:
|
||||
)
|
||||
|
||||
else:
|
||||
self.app.recording_enabled = True
|
||||
self.app.recording_enabled = True
|
||||
@@ -8,6 +8,7 @@ class RecordingStatus:
|
||||
PREPARING_RECORDING = "PREPARING_RECORDING"
|
||||
RECORDING_ERROR = "RECORDING_ERROR"
|
||||
NOT_RECORDING_SPACE = "NOT_RECORDING_SPACE"
|
||||
LIVE_STATUS_CHECK_ERROR = "LIVE_STATUS_CHECK_ERROR"
|
||||
|
||||
@classmethod
|
||||
def get_status(cls):
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
"PREPARING_RECORDING": "Preparing to Start Recording",
|
||||
"RECORDING_ERROR": "Recording the live stream has failed",
|
||||
"NOT_RECORDING_SPACE": "Insufficient disk space to record",
|
||||
"LIVE_STATUS_CHECK_ERROR": "Live status error, check address accessibility",
|
||||
"not_disk_space_tip": "⚠️ Insufficient disk storage space, stop recording"
|
||||
},
|
||||
"stream_manager": {
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
"PREPARING_RECORDING": "主播正在直播中, 准备开始录制",
|
||||
"RECORDING_ERROR": "直播录制失败, 等待重试",
|
||||
"NOT_RECORDING_SPACE": "磁盘空间不足, 无法录制",
|
||||
"LIVE_STATUS_CHECK_ERROR": "直播状态检测错误, 请检查地址是否可正常访问",
|
||||
"not_disk_space_tip": "⚠️ 磁盘存储空间不足, 停止录制"
|
||||
},
|
||||
"stream_manager": {
|
||||
|
||||
Reference in New Issue
Block a user