aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/dl_formats.py9
-rw-r--r--ui/src/app/formats.ts7
2 files changed, 16 insertions, 0 deletions
diff --git a/app/dl_formats.py b/app/dl_formats.py
index c06b93b..316d5df 100644
--- a/app/dl_formats.py
+++ b/app/dl_formats.py
@@ -19,6 +19,10 @@ def get_format(format: str, quality: str) -> str:
if format.startswith("custom:"):
return format[7:]
+ if format == "thumbnail":
+ # Quality is irrelevant in this case since we skip the download
+ return "bestaudio/best"
+
if format == "mp3":
# Audio quality needs to be set post-download, set in opts
return "bestaudio/best"
@@ -66,4 +70,9 @@ def get_opts(format: str, quality: str, ytdl_opts: dict) -> dict:
opts["postprocessors"].append({"key": "FFmpegMetadata"})
opts["postprocessors"].append({"key": "EmbedThumbnail"})
+ if format == "thumbnail":
+ opts["skip_download"] = True
+ opts["writethumbnail"] = True
+ opts["postprocessors"].append({"key": "FFmpegThumbnailsConvertor", "format": "jpg", "when": "before_dl"})
+
return opts
diff --git a/ui/src/app/formats.ts b/ui/src/app/formats.ts
index 15be903..a3bf3e8 100644
--- a/ui/src/app/formats.ts
+++ b/ui/src/app/formats.ts
@@ -43,4 +43,11 @@ export const Formats: Format[] = [
{ id: '128', text: '128 kbps' },
],
},
+ {
+ id: 'thumbnail',
+ text: 'Thumbnail',
+ qualities: [
+ { id: 'best', text: 'Best' }
+ ],
+ },
];
bgstack15