fix: enforce Player download height limit
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user