feat: 将下载视频时选择流的部分参数提取为配置 (#47)

This commit is contained in:
ᴀᴍᴛᴏᴀᴇʀ
2024-02-24 17:36:56 +08:00
committed by GitHub
parent bde142a896
commit c21da25c6f
2 changed files with 30 additions and 11 deletions

View File

@@ -358,7 +358,7 @@ async def get_video(v: video.Video, page_id: int, tmp_video_path: Path, tmp_audi
await amakedirs(video_path.parent, exist_ok=True)
# 分析对应分p的视频流
detector = video.VideoDownloadURLDataDetecter(await v.get_download_url(page_index=page_id))
streams = detector.detect_best_streams()
streams = detector.detect_best_streams(**settings.stream.model_dump())
if detector.check_flv_stream():
# 对于 flv直接下载
await download_content(streams[0].url, tmp_video_path)