mirror of
https://github.com/acgnhiki/blrec.git
synced 2025-01-15 04:40:07 +08:00
release: 1.2.4
This commit is contained in:
parent
047c098271
commit
e8d655ef2b
@ -1,5 +1,10 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
## 1.2.4
|
||||||
|
|
||||||
|
- 修复回收空间时文件不存在异常
|
||||||
|
- 修复章节标记时间异常导致转封装出错
|
||||||
|
|
||||||
## 1.2.3
|
## 1.2.3
|
||||||
|
|
||||||
- 修复直播间标题有特殊字符导致文件创建失败
|
- 修复直播间标题有特殊字符导致文件创建失败
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
__prog__ = 'blrec'
|
__prog__ = 'blrec'
|
||||||
__version__ = '1.2.3'
|
__version__ = '1.2.4'
|
||||||
__github__ = 'https://github.com/acgnhiki/blrec'
|
__github__ = 'https://github.com/acgnhiki/blrec'
|
||||||
|
@ -331,6 +331,9 @@ class StreamRecorder(
|
|||||||
logger.debug('Response received')
|
logger.debug('Response received')
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
|
if self._stopped:
|
||||||
|
return
|
||||||
|
|
||||||
assert self._stream_processor is not None
|
assert self._stream_processor is not None
|
||||||
self._stream_processor.process_stream(
|
self._stream_processor.process_stream(
|
||||||
io.BufferedReader(
|
io.BufferedReader(
|
||||||
|
@ -7,6 +7,12 @@ import asyncio
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
from typing import Iterable, List
|
from typing import Iterable, List
|
||||||
|
|
||||||
|
from tenacity import (
|
||||||
|
retry,
|
||||||
|
wait_none,
|
||||||
|
stop_after_attempt,
|
||||||
|
retry_if_exception_type,
|
||||||
|
)
|
||||||
|
|
||||||
from .helpers import delete_file, is_space_enough
|
from .helpers import delete_file, is_space_enough
|
||||||
from .space_monitor import SpaceMonitor, DiskUsage, SpaceEventListener
|
from .space_monitor import SpaceMonitor, DiskUsage, SpaceEventListener
|
||||||
@ -65,6 +71,11 @@ class SpaceReclaimer(SpaceEventListener, SwitchableMixin):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@retry(
|
||||||
|
retry=retry_if_exception_type(OSError),
|
||||||
|
wait=wait_none(),
|
||||||
|
stop=stop_after_attempt(3),
|
||||||
|
)
|
||||||
async def _get_record_file_paths(self, max_ctime: float) -> List[str]:
|
async def _get_record_file_paths(self, max_ctime: float) -> List[str]:
|
||||||
glob_path = os.path.join(self.path, '*/**/*.*')
|
glob_path = os.path.join(self.path, '*/**/*.*')
|
||||||
paths: Iterable[Path]
|
paths: Iterable[Path]
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import logging
|
||||||
import json
|
import json
|
||||||
from typing import Iterable, cast
|
from typing import Iterable, cast
|
||||||
|
|
||||||
@ -8,6 +9,9 @@ from ..flv.stream_processor import JoinPoint
|
|||||||
from ..flv.helpers import make_comment_for_joinpoints
|
from ..flv.helpers import make_comment_for_joinpoints
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
async def make_metadata_file(flv_path: str) -> str:
|
async def make_metadata_file(flv_path: str) -> str:
|
||||||
path = flv_path + '.meta'
|
path = flv_path + '.meta'
|
||||||
async with aiofiles.open(path, 'wb') as f:
|
async with aiofiles.open(path, 'wb') as f:
|
||||||
@ -57,11 +61,16 @@ def _make_chapters(
|
|||||||
|
|
||||||
result = ''
|
result = ''
|
||||||
for i in range(1, len(timestamps)):
|
for i in range(1, len(timestamps)):
|
||||||
|
start = timestamps[i - 1]
|
||||||
|
end = timestamps[i]
|
||||||
|
if end < start:
|
||||||
|
logger.warning(f'Chapter end time {end} before start {start}')
|
||||||
|
end = start
|
||||||
result += f"""\
|
result += f"""\
|
||||||
[CHAPTER]
|
[CHAPTER]
|
||||||
TIMEBASE=1/1000
|
TIMEBASE=1/1000
|
||||||
START={timestamps[i-1]}
|
START={start}
|
||||||
END={timestamps[i]}
|
END={end}
|
||||||
title=segment \\#{i}
|
title=segment \\#{i}
|
||||||
"""
|
"""
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user