Skip to content

The only downloader you need. 下载器的集大成者。

fix(m3u8): 暂存文件改用固定短名并修复日志解码

XiaoYouChR98b0459a83e7
diff --git a/dist/packs/m3u8_pack.zip b/dist/packs/m3u8_pack.zip
index a65fe381..7c60da8e 100644
Binary files a/dist/packs/m3u8_pack.zip and b/dist/packs/m3u8_pack.zip differ
diff --git a/features/m3u8_pack/manifest.toml b/features/m3u8_pack/manifest.toml
index ac0525c1..366698ae 100644
--- a/features/m3u8_pack/manifest.toml
+++ b/features/m3u8_pack/manifest.toml
@@ -2,5 +2,5 @@
entry = "pack.py"
class = "M3U8Pack"
dependencies = ["ffmpeg_pack"]
-version = "1.3.2"
+version = "1.3.3"
gdMinVersion = "4.5.0"
diff --git a/features/m3u8_pack/pack.py b/features/m3u8_pack/pack.py
index d9d88a75..29cdd063 100644
--- a/features/m3u8_pack/pack.py
+++ b/features/m3u8_pack/pack.py
@@ -180,7 +180,6 @@ class M3U8Parser(TaskParser):
url=url,
fileSize=1,
outputFolder=outputFolder,
- manifestType=manifestType,
isLive=isLive,
streams=streams,
)
diff --git a/features/m3u8_pack/task.py b/features/m3u8_pack/task.py
index 8c708d4f..6cae6428 100644
--- a/features/m3u8_pack/task.py
+++ b/features/m3u8_pack/task.py
@@ -3,6 +3,7 @@ from __future__ import annotations
import asyncio
import os
import re
+import sys
from collections.abc import Awaitable, Callable
from contextlib import suppress
from dataclasses import dataclass, field
@@ -33,6 +34,7 @@ LIVE_RECORD_PATTERN = re.compile(
)
MANIFEST_SUFFIXES = {".m3u8", ".m3u", ".mpd"}
IGNORED_OUTPUT_SUFFIXES = {".json", ".txt", ".log", ".tmp", ".ghd"}
+OUTPUT_STEM = "output"
DECRYPTION_ENGINES = {
"FFmpeg": "FFMPEG",
"MP4Decrypt": "MP4DECRYPT",
@@ -60,10 +62,9 @@ ERROR_HINTS = (
"SSL 连接失败,请检查网络连接({detail})"),
)
-LOG_LINE_PATTERN = re.compile(
- r"\d{2}:\d{2}:\d{2}\.\d{3}\s+(WARN|ERROR)\s*:\s*(.*)"
+LOG_PATTERN = re.compile(
+ r"\d{2}:\d{2}:\d{2}\.\d{3}\s+(INFO|WARN|ERROR)\s*:\s*"
)
-LOG_PREFIX_PATTERN = re.compile(r"\d{2}:\d{2}:\d{2}\.\d{3}\s+(?:INFO|WARN|ERROR)\s*:\s*")
MUX_FAILED_PATTERN = re.compile(r"\d{2}:\d{2}:\d{2}\.\d{3}\s+ERROR\s*:\s*Mux failed")
UNHANDLED_PATTERN = re.compile(
r"Unhandled exception:\s*\S+:\s*(.*)"
@@ -74,23 +75,35 @@ def toBool(value: bool) -> str:
return "true" if value else "false"
+def decodeText(data: bytes, fallbackEncoding: str = "") -> str:
+ try:
+ return data.decode("utf-8")
+ except UnicodeDecodeError:
+ encoding = fallbackEncoding or ("oem" if sys.platform == "win32" else "utf-8")
+ return data.decode(encoding, errors="replace")
+
+
+def parseLogs(output: str) -> list[tuple[str, str]]:
+ parts = LOG_PATTERN.split(output)
+ return [(level, body.strip()) for level, body in zip(parts[1::2], parts[2::2]) if body.strip()]
+
+
def parseError(output: str, returncode: int) -> TaskError | None:
"""输出表明失败时返回 TaskError,成功时返回 None。"""
# N_m3u8DL-RE 0.6.0-beta 混流失败仍以 0 退出
muxFailure = MUX_FAILED_PATTERN.search(output)
if muxFailure:
- lines = [line.strip() for line in LOG_PREFIX_PATTERN.split(output[:muxFailure.start()]) if line.strip()]
- return TaskError("合并音视频失败({detail})", detail=lines[-1] if lines else "")
+ entries = parseLogs(output[:muxFailure.start()])
+ return TaskError("合并音视频失败({detail})", detail=entries[-1][1] if entries else "")
if returncode == 0:
return None
+ detail = parseDiagnostic(output)
lowered = output.lower()
for needle, message in ERROR_HINTS:
if needle in lowered:
- detail = parseDiagnostic(output)
return TaskError(message, detail=detail)
- detail = parseDiagnostic(output)
return TaskError(
"进程异常退出({code}):{detail}",
code=returncode,
@@ -100,22 +113,36 @@ def parseError(output: str, returncode: int) -> TaskError | None:
def parseDiagnostic(output: str) -> str:
last = ""
- for m in LOG_LINE_PATTERN.finditer(output):
- last = m.group(2).strip()
+ for level, body in parseLogs(output):
+ if level in {"WARN", "ERROR"}:
+ last = body
cut = last.find("Unhandled exception:")
if cut > 0:
last = last[:cut].strip()
if last:
- return last
+ return last.splitlines()[0].strip()
m = UNHANDLED_PATTERN.search(output)
return m.group(1).strip() if m else ""
+def findOutputFile(folder: Path, preferredSuffix: str = "") -> Path | None:
+ if not folder.is_dir():
+ return None
+ prefix = f"{OUTPUT_STEM}."
+ preferred = preferredSuffix.lower()
+ return max(
+ (c for c in folder.iterdir()
+ if c.is_file() and c.suffix.lower() not in IGNORED_OUTPUT_SUFFIXES
+ and c.name.lower().startswith(prefix)),
+ key=lambda c: (c.suffix.lower() == preferred, c.stat().st_mtime),
+ default=None,
+ )
+
+
@dataclass(kw_only=True, eq=False)
class M3U8Task(Task):
packId: str = "m3u8"
canEdit = True
- manifestType: str = "m3u8"
isLive: bool = False
streams: list[dict] = field(default_factory=list)
subtitleLanguages: list[str] = field(default_factory=list)
@@ -127,7 +154,7 @@ class M3U8Task(Task):
if self.isLive and self.status in {TaskStatus.PAUSED, TaskStatus.RUNNING}:
for step in self.steps:
if isinstance(step, M3U8TaskStep) and step.status != TaskStatus.COMPLETED:
- step._findOutputFile()
+ step.moveOutput()
step.status = TaskStatus.COMPLETED
step.progress = 100
step.speed = 0
@@ -199,10 +226,8 @@ class M3U8TaskStep(TaskStep):
liveWaitTime: int = 0
liveTakeCount: int = 0
recordLimit: str = ""
- lastMessage: str = ""
liveStatus: str = ""
liveElapsed: str = ""
- liveTotal: str = ""
@property
def canPause(self) -> bool:
@@ -220,10 +245,6 @@ class M3U8TaskStep(TaskStep):
def _tempFolder(self) -> str:
return toPosixPath(self._saveFolder / "tmp")
- @property
- def _saveName(self) -> str:
- return Path(self.task.name).stem
-
def setOptions(self, options: dict) -> None:
if "headers" in options:
self.headers = options["headers"]
@@ -258,7 +279,7 @@ class M3U8TaskStep(TaskStep):
(folder / name).write_bytes(data)
return toPosixPath(folder / "master.m3u8")
- def _buildCommand(self, source: str) -> list[str]:
+ def buildCommand(self, source: str) -> list[str]:
args = [source, *self._buildTransferArgs()]
if self.shouldSelectAllAudioSubtitle:
@@ -304,7 +325,7 @@ class M3U8TaskStep(TaskStep):
def _buildTransferArgs(self) -> list[str]:
args = [
f"--save-dir={toPosixPath(self._saveFolder)}",
- f"--save-name={self._saveName}",
+ f"--save-name={OUTPUT_STEM}",
f"--tmp-dir={self._tempFolder}",
f"--thread-count={self.threadCount}",
f"--download-retry-count={self.retryCount}",
@@ -366,8 +387,6 @@ class M3U8TaskStep(TaskStep):
if not text:
return
- self.lastMessage = text[-1000:]
-
vodMatch = None
for m in VOD_PROGRESS_PATTERN.finditer(text):
vodMatch = m
@@ -386,7 +405,6 @@ class M3U8TaskStep(TaskStep):
liveMatch = m
if liveMatch:
self.liveElapsed = liveMatch.group(1)
- self.liveTotal = liveMatch.group(2)
self.liveStatus = liveMatch.group(3)
self.progress = float(liveMatch.group(4))
self.speed = 0 if liveMatch.group(5) == "-" else toBytes(liveMatch.group(6), liveMatch.group(7))
@@ -397,20 +415,18 @@ class M3U8TaskStep(TaskStep):
recordMatch = m
if recordMatch:
self.liveElapsed = recordMatch.group(1)
- self.liveTotal = recordMatch.group(2)
self.liveStatus = recordMatch.group(3)
self.speed = 0 if recordMatch.group(4) == "-" else toBytes(recordMatch.group(5), recordMatch.group(6))
- async def _readOutput(self, stream: asyncio.StreamReader):
- rawChunks = []
+ async def _readOutput(self, stream: asyncio.StreamReader) -> str:
+ rawChunks: list[bytes] = []
buffer = ""
while True:
chunk = await stream.read(4096)
if not chunk:
break
- raw = chunk.decode("utf-8", errors="ignore")
- rawChunks.append(raw)
- buffer += raw
+ rawChunks.append(chunk)
+ buffer += chunk.decode("utf-8", errors="ignore")
buffer = buffer.replace("\r\n", "\n").replace("\r", "\n")
lines = buffer.split("\n")
buffer = lines.pop()
@@ -422,22 +438,14 @@ class M3U8TaskStep(TaskStep):
buffer = buffer[-4096:]
if buffer.strip():
self.parseOutputLine(buffer)
- self._processOutput = "".join(rawChunks)
+ return decodeText(b"".join(rawChunks))
- def _findOutputFile(self) -> bool:
+ def moveOutput(self) -> bool:
target = Path(self.outputPath)
if target.is_file() and target.stat().st_size > 0:
self.task.fileSize = max(self.task.fileSize, target.stat().st_size)
return True
-
- prefix = f"{self._saveName.lower()}."
- found = max(
- (c for c in self.task.partPath.glob("*")
- if c.is_file() and c.suffix.lower() not in IGNORED_OUTPUT_SUFFIXES
- and c.name.lower().startswith(prefix)),
- key=lambda c: (c.suffix.lower() == target.suffix.lower(), c.stat().st_mtime),
- default=None,
- )
+ found = findOutputFile(self._saveFolder, target.suffix)
if found is None:
return False
self.task.fileSize = max(self.task.fileSize, found.stat().st_size)
@@ -465,7 +473,7 @@ class M3U8TaskStep(TaskStep):
outputTask = None
try:
source = await self._writeVimeoFiles() if matchVimeoPlaylist(self.task.url) else self.task.url
- command = self._buildCommand(source)
+ command = self.buildCommand(source)
self._process = await asyncio.create_subprocess_exec(
execPath, *command,
cwd=Path(execPath).parent,
@@ -477,19 +485,18 @@ class M3U8TaskStep(TaskStep):
outputTask = asyncio.create_task(self._readOutput(self._process.stdout))
await self._process.wait()
- await outputTask
+ output = await outputTask
- output = getattr(self, "_processOutput", "")
error = parseError(output, self._process.returncode)
if error is not None and not self._stopping:
if output:
logger.warning("N_m3u8DL-RE output:\n{}", output[-8192:])
raise error
- if not self._findOutputFile():
+ if not self.moveOutput():
raise TaskError(
"未找到输出文件:{detail}",
- detail=self.lastMessage[-200:] if self.lastMessage else "",
+ detail=parseDiagnostic(output) or "N_m3u8DL-RE",
)
except asyncio.CancelledError:
if self._process is not None and self._process.returncode is None:
@@ -504,7 +511,7 @@ class M3U8TaskStep(TaskStep):
with suppress(asyncio.CancelledError):
await outputTask
if self.task.isLive:
- self._findOutputFile()
+ self.moveOutput()
self.setStatus(TaskStatus.COMPLETED)
else:
self.setStatus(TaskStatus.PAUSED)
@@ -532,14 +539,14 @@ class M3U8SubtitleStep(M3U8TaskStep):
def _saveFolder(self) -> Path:
return self.task.partPath / f"subtitle{self.stepIndex}"
- def _buildCommand(self, source: str) -> list[str]:
+ def buildCommand(self, source: str) -> list[str]:
selector = f'lang="^{re.escape(self.language)}$"' if self.language else f'name="^{re.escape(self.name)}$"'
return [source, *self._buildTransferArgs(), "--sub-only", f"--select-subtitle={selector}:for=best"]
- def _findOutputFile(self) -> bool:
+ def moveOutput(self) -> bool:
target = Path(self.outputPath)
- found = next((c for c in self._saveFolder.glob("*") if c.is_file() and c.suffix.lower() == target.suffix), None)
- if found is None:
+ found = findOutputFile(self._saveFolder, target.suffix)
+ if found is None or found.suffix.lower() != target.suffix.lower():
# 清单里的字幕已下架时只少一个 Side File,不算任务失败
deletePlaceholder(target)
return True
diff --git a/tests/m3u8_pack/test_task.py b/tests/m3u8_pack/test_task.py
index 9c91ecaa..70aaf7e6 100644
--- a/tests/m3u8_pack/test_task.py
+++ b/tests/m3u8_pack/test_task.py
@@ -2,6 +2,7 @@ from __future__ import annotations
from pathlib import Path
+from app.models.task import TaskStatus
from features.m3u8_pack.task import M3U8Task, M3U8TaskStep
@@ -31,3 +32,30 @@ def test_set_name_keeps_non_manifest_suffix():
task.setName("clip")
assert task.name == "clip"
+
+
+def test_load_running_live_completes_with_output(tmp_path: Path):
+ target = tmp_path / "live.ts"
+ target.write_bytes(b"")
+ part = tmp_path / "live.ts.ghd"
+ part.mkdir()
+
+ probe = M3U8Task(name="live.ts", url="http://test", fileSize=1, outputFolder=tmp_path, isLive=True)
+ probeStep = M3U8TaskStep(stepIndex=1)
+ probe.addStep(probeStep)
+ saveName = next(a.removeprefix("--save-name=") for a in probeStep.buildCommand("http://test") if a.startswith("--save-name="))
+ (part / f"{saveName}.ts").write_bytes(b"recorded-stream")
+
+ step = M3U8TaskStep(stepIndex=1, status=TaskStatus.RUNNING)
+ task = M3U8Task(
+ name="live.ts",
+ url="http://test",
+ fileSize=1,
+ outputFolder=tmp_path,
+ isLive=True,
+ status=TaskStatus.RUNNING,
+ steps=[step],
+ )
+
+ assert task.status == TaskStatus.COMPLETED
+ assert target.read_bytes() == b"recorded-stream"
diff --git a/tests/m3u8_pack/test_task_error.py b/tests/m3u8_pack/test_task_error.py
index 38dcb122..41ade1a0 100644
--- a/tests/m3u8_pack/test_task_error.py
+++ b/tests/m3u8_pack/test_task_error.py
@@ -1,4 +1,4 @@
-from features.m3u8_pack.task import parseDiagnostic, parseError
+from features.m3u8_pack.task import decodeText, parseDiagnostic, parseError
# -- parseDiagnostic ----------------------------------------------------------
@@ -193,3 +193,28 @@ def test_parse_success_returns_none():
"19:18:15.736 INFO : Done"
)
assert parseError(output, 0) is None
+
+
+def test_parse_glued_logs_takes_last_warning():
+ output = (
+ "21:47:26.100 WARN : Muxing to output.MUX.mp4"
+ "21:47:26.120 WARN : Cleaning files..."
+ "21:47:26.121 WARN : Rename to output.mp4"
+ "21:47:26.125 INFO : Done"
+ )
+ assert parseDiagnostic(output) == "Rename to output.mp4"
+
+
+def test_decode_utf8_preserves_text():
+ text = "22:00:00.000 INFO : 二进制合并中... ━━━ X 上的测试"
+ assert decodeText(text.encode("utf-8"), fallbackEncoding="gbk") == text
+
+
+def test_decode_gbk_recovers_console_text():
+ text = "21:47:26.120 WARN : Rename to (1) X 上的 Alexey Fateev:“https t.co FkpOOsDFNI”.mp4"
+ assert decodeText(text.encode("gbk"), fallbackEncoding="gbk") == text
+
+
+def test_decode_invalid_bytes_keeps_readable_text():
+ decoded = decodeText(b"\xff\xfehello", fallbackEncoding="utf-8")
+ assert "hello" in decoded
diff --git a/tests/m3u8_pack/test_task_step.py b/tests/m3u8_pack/test_task_step.py
index ec592592..5e2802e7 100644
--- a/tests/m3u8_pack/test_task_step.py
+++ b/tests/m3u8_pack/test_task_step.py
@@ -1,26 +1,32 @@
from __future__ import annotations
+import os
from pathlib import Path
import pytest
from app.config.cfg import cfg
from app.format import toBytes
-from features.m3u8_pack.task import M3U8Task, M3U8TaskStep
+from features.m3u8_pack.task import M3U8SubtitleStep, M3U8Task, M3U8TaskStep
-def buildStep() -> M3U8TaskStep:
+def buildStep(name: str = "test.mp4", outputFolder: Path = Path("."), *, isLive: bool = False) -> M3U8TaskStep:
task = M3U8Task(
- name="test.mp4",
+ name=name,
url="http://test",
fileSize=1,
- outputFolder=Path("."),
+ outputFolder=outputFolder,
+ isLive=isLive,
)
step = M3U8TaskStep(stepIndex=1)
task.addStep(step)
return step
+def saveNameOf(step: M3U8TaskStep) -> str:
+ return next(a.removeprefix("--save-name=") for a in step.buildCommand("http://test") if a.startswith("--save-name="))
+
+
def test_parse_vod_progress_with_sizes():
step = buildStep()
step.parseOutputLine(
@@ -90,7 +96,6 @@ def test_parse_live_progress():
"Vid ━━━━━━ 01m30s/02m00s 125/250 Recording 50% 1.55MBps"
)
assert step.liveElapsed == "01m30s"
- assert step.liveTotal == "02m00s"
assert step.liveStatus == "Recording"
assert step.progress == pytest.approx(50)
assert step.speed == toBytes("1.55", "MBps")
@@ -102,7 +107,6 @@ def test_parse_live_progress_over_an_hour():
"Vid ━━━━━━ 01h05m30s/01h30m00s 3000/4500 Recording 66% 2.10MBps"
)
assert step.liveElapsed == "01h05m30s"
- assert step.liveTotal == "01h30m00s"
assert step.progress == pytest.approx(66)
@@ -122,7 +126,6 @@ def test_parse_live_record_progress():
"Vid ━━━━━━ 01m30s/02m00s 130.00MB 125/250 Recording 1.55MBps"
)
assert step.liveElapsed == "01m30s"
- assert step.liveTotal == "02m00s"
assert step.liveStatus == "Recording"
assert step.speed == toBytes("1.55", "MBps")
assert step.progress == 0
@@ -134,7 +137,6 @@ def test_parse_live_record_progress_over_an_hour():
"Vid ━━━━━━ 02h10m00s/02h15m30s 5.12GB 9000/9500 Recording 30.00MBps"
)
assert step.liveElapsed == "02h10m00s"
- assert step.liveTotal == "02h15m30s"
assert step.speed == toBytes("30.00", "MBps")
@@ -150,5 +152,142 @@ def test_parse_live_record_progress_without_speed():
def test_build_command_converts_global_speed_limit(monkeypatch):
monkeypatch.setattr(cfg.isSpeedLimitEnabled, "value", True)
monkeypatch.setattr(cfg.speedLimitation, "value", 1150976)
- args = buildStep()._buildCommand("http://test")
+ args = buildStep().buildCommand("http://test")
assert "--max-speed=1124K" in args
+
+
+ "(1) X 上的 Alexey Fateev:“https t.co FkpOOsDFNI shipped GLM-5.4”.mp4",
+ "clip....mp4",
+ ".hidden.mp4",
+ "trailing space .mp4",
+])
+def test_build_command_uses_safe_save_name(tmp_path: Path, name: str):
+ step = buildStep(name=name, outputFolder=tmp_path)
+ saveName = saveNameOf(step)
+ assert saveName.isascii()
+ assert len(saveName) <= 16
+ assert saveName == saveName.strip(". ")
+ assert Path(name).stem not in saveName
+
+
+def test_build_subtitle_command_uses_safe_save_name(tmp_path: Path):
+ task = M3U8Task(
+ name="(3) X 上的 BBC News 中文:“在北京郊外”.mp4",
+ url="http://test",
+ fileSize=1,
+ outputFolder=tmp_path,
+ subtitleLanguages=["zh"],
+ )
+ step = M3U8SubtitleStep(stepIndex=2, language="zh", name="zh")
+ task.addStep(step)
+
+ args = step.buildCommand("http://test")
+ saveName = saveNameOf(step)
+ assert saveName.isascii()
+ assert len(saveName) <= 16
+ assert "--sub-only" in args
+
+
+def test_move_output_prefers_target_suffix_and_updates_file_size(tmp_path: Path):
+ step = buildStep(name="clip....mp4", outputFolder=tmp_path)
+ target = Path(step.outputPath)
+ target.write_bytes(b"")
+
+ part = step.task.partPath
+ part.mkdir()
+ saveName = saveNameOf(step)
+ tsFile = part / f"{saveName}.ts"
+ mp4File = part / f"{saveName}.mp4"
+ tsFile.write_bytes(b"raw-ts")
+ mp4File.write_bytes(b"muxed-mp4-data")
+ os.utime(mp4File, (100, 100))
+ os.utime(tsFile, (200, 200))
+
+ assert step.moveOutput() is True
+ assert target.read_bytes() == b"muxed-mp4-data"
+ assert step.task.fileSize == len(b"muxed-mp4-data")
+ assert not mp4File.exists()
+
+
+def test_move_output_falls_back_to_newest_file(tmp_path: Path):
+ step = buildStep(name="clip.mp4", outputFolder=tmp_path)
+ target = Path(step.outputPath)
+ target.write_bytes(b"")
+
+ part = step.task.partPath
+ part.mkdir()
+ saveName = saveNameOf(step)
+ (part / f"{saveName}.log").write_text("log")
+ (part / "stale.mp4").write_bytes(b"stale")
+ older = part / f"{saveName}.m4a"
+ newer = part / f"{saveName}.ts"
+ older.write_bytes(b"old")
+ newer.write_bytes(b"new-ts")
+ os.utime(older, (100, 100))
+ os.utime(newer, (200, 200))
+
+ assert step.moveOutput() is True
+ assert target.read_bytes() == b"new-ts"
+
+
+def test_move_output_keeps_existing_file(tmp_path: Path):
+ step = buildStep(name="clip.mp4", outputFolder=tmp_path)
+ target = Path(step.outputPath)
+ target.write_bytes(b"already-final")
+
+ assert step.moveOutput() is True
+ assert target.read_bytes() == b"already-final"
+ assert step.task.fileSize == len(b"already-final")
+
+
+def test_move_output_fails_when_part_missing(tmp_path: Path):
+ step = buildStep(name="clip.mp4", outputFolder=tmp_path)
+ Path(step.outputPath).write_bytes(b"")
+
+ assert step.moveOutput() is False
+
+ step.task.partPath.mkdir()
+ (step.task.partPath / "other.mp4").write_bytes(b"wrong-prefix")
+ assert step.moveOutput() is False
+
+
+def test_move_subtitle_replaces_placeholder(tmp_path: Path):
+ task = M3U8Task(
+ name="clip.mp4",
+ url="http://test",
+ fileSize=1,
+ outputFolder=tmp_path,
+ subtitleLanguages=["zh"],
+ )
+ step = M3U8SubtitleStep(stepIndex=2, language="zh", name="zh")
+ task.addStep(step)
+
+ target = Path(step.outputPath)
+ target.write_bytes(b"")
+
+ saveDir = task.partPath / "subtitle2"
+ saveDir.mkdir(parents=True)
+ saveName = saveNameOf(step)
+ (saveDir / f"{saveName}.zh.srt").write_text("1\n00:00:00,000 --> 00:00:01,000\nhi\n", encoding="utf-8")
+
+ assert step.moveOutput() is True
+ assert "hi" in target.read_text(encoding="utf-8")
+
+
+def test_move_missing_subtitle_deletes_placeholder(tmp_path: Path):
+ task = M3U8Task(
+ name="clip.mp4",
+ url="http://test",
+ fileSize=1,
+ outputFolder=tmp_path,
+ subtitleLanguages=["en"],
+ )
+ step = M3U8SubtitleStep(stepIndex=2, language="en", name="en")
+ task.addStep(step)
+
+ target = Path(step.outputPath)
+ target.write_bytes(b"")
+
+ assert step.moveOutput() is True
+ assert not target.exists()
diff --git a/versions.json b/versions.json
index 7f8d2ec4..1a62fd0d 100644
--- a/versions.json
+++ b/versions.json
@@ -110,9 +110,9 @@
"gdMinVersion": "4.5.0"
},
"m3u8_pack": {
- "version": "1.3.2",
+ "version": "1.3.3",
"file": "m3u8_pack.zip",
- "sha256": "256ff6ea4069dec8bcdc27992fb99be541feb03994105a766ba08a83bb70c223",
+ "sha256": "c1028457217598a6e9f614374983b6764fdf105d7fd73694bbcd0f03ccefe14e",
"gdMinVersion": "4.5.0"
},
"yt_dlp_pack": {