summaryrefslogtreecommitdiff
path: root/bin/yt-dlp-scrot
diff options
context:
space:
mode:
Diffstat (limited to 'bin/yt-dlp-scrot')
-rwxr-xr-xbin/yt-dlp-scrot6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/yt-dlp-scrot b/bin/yt-dlp-scrot
new file mode 100755
index 00000000..a569bf7c
--- /dev/null
+++ b/bin/yt-dlp-scrot
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# source: https://news.ycombinator.com/item?id=39288379
+# The -ss must come before the -i to avoid downloading the whole video.
+ffmpeg -ss "${2:-01:23}" -i "$(yt-dlp "$1" --get-url | head -n1)" \
+ -t 1 -r 4/1 -q:v 2 -vf scale=0:-1 "${3:-folder}%02d.png"