fix: enforce Player download height limit

This commit is contained in:
Media
2026-08-12 18:18:38 -05:00
parent c2544c44c7
commit 8db46df69e
2 changed files with 128 additions and 6 deletions
+7 -4
View File
@@ -57,6 +57,12 @@ def canonical_playlist_path(media_base: Path, slot: int) -> Path:
return canonical_slot_directory(media_base, slot) / "playlist.m3u"
def player_format_selector(max_height: int) -> str:
"""Select the best Player media without exceeding its configured height."""
return f"bv*[height<={max_height}]+ba/b[height<={max_height}]"
def title_from_filename(path: Path) -> str:
stem = path.stem
if " - " in stem:
@@ -297,10 +303,7 @@ class DownloadManager:
/ "%(playlist_index)03d - %(title)s [%(id)s].%(ext)s"
),
"-f",
(
f"bv*[height<={self.config.downloads.max_height}]+ba/"
f"b[height<={self.config.downloads.max_height}]/b"
),
player_format_selector(self.config.downloads.max_height),
url,
]
self._run_command(