feat: 补全短剧全量清单并接入 DramaBox 官网登录

This commit is contained in:
Nixevol
2026-10-22 02:20:16 +08:00
parent 39774ad9cc
commit 00e78661a7
22 changed files with 894 additions and 194 deletions
+7 -1
View File
@@ -66,12 +66,18 @@ def convert_to_mp4(episode_dir: Path, mp4_path: Path) -> None:
temporary.unlink(missing_ok=True)
detail = (completed.stderr or b"").decode("utf-8", "replace")[-400:]
raise RuntimeError("转换成 MP4 失败" + (f":{detail}" if detail else ""))
if not _output_has_audio(exe, temporary):
if not has_audio(temporary):
temporary.unlink(missing_ok=True)
raise RuntimeError("合成结果没有音轨。音频分片没有下载到,或者音频地址已经过期。")
temporary.replace(mp4_path)
def has_audio(media: Path) -> bool:
if not media.is_file() or media.stat().st_size <= 0:
return False
return _output_has_audio(ensure_ffmpeg(), media)
def _output_has_audio(exe: Path, media: Path) -> bool:
completed = subprocess.run(
[str(exe), "-hide_banner", "-i", str(media)],