Added video download flag and config (#134)

This commit is contained in:
xiliourt
2025-07-17 19:21:41 +10:00
committed by GitHub
parent a4a7e66b84
commit d85fb96a19
2 changed files with 12 additions and 3 deletions
+11 -3
View File
@@ -87,6 +87,13 @@ from typing import List, Union
is_flag=True,
help="Embed track lyrics in file metadata.",
)
@click.option(
"--video",
"-v",
"DOWNLOAD_VIDEO",
is_flag=True,
help="Enable downloading videos",
)
@passContext
def DownloadCommand(
ctx: Context,
@@ -96,10 +103,11 @@ def DownloadCommand(
THREADS_COUNT: int,
DO_NOT_SKIP: bool,
SINGLES_FILTER: SinglesFilter,
EMBED_LYRICS: bool
EMBED_LYRICS: bool,
DOWNLOAD_VIDEO: bool
):
"""Download resources"""
DOWNLOAD_VIDEO = DOWNLOAD_VIDEO or ctx.obj.config.download.download_video
SINGLES_FILTER = SINGLES_FILTER or ctx.obj.config.download.singles_filter
EMBED_LYRICS = EMBED_LYRICS or ctx.obj.config.download.embed_lyrics
@@ -265,7 +273,7 @@ def DownloadCommand(
logging.warning(f"Track '{item.title}' skipped")
return
elif isinstance(item, Video):
if path.with_suffix(".mp4").exists():
if path.with_suffix(".mp4").exists() or not DOWNLOAD_VIDEO:
logging.warning(f"Video '{item.title}' skipped")
return
+1
View File
@@ -28,6 +28,7 @@ class DownloadConfig(BaseModel):
threads: int = 4
singles_filter: SinglesFilter = "none"
embed_lyrics: bool = False
download_video: bool = False
class AuthConfig(BaseModel):