gentoo-dots/.config/qutebrowser/userscripts/yt-dlp

24 lines
795 B
Plaintext
Raw Normal View History

2023-11-28 09:24:19 +01:00
#!/bin/sh
audio() {
printf "message-info 'Downloding audio for %s'" "$QUTE_URL" >>"$QUTE_FIFO"
yt-dlp -x -f bestaudio --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --audio-format vorbis -o "%(title)s.%(ext)s" "$QUTE_URL"
notify-send "QuteBrowser yt-dlp" "Finished downloading audio"
}
audio_video() {
printf "message-info 'Downloding audio+video for %s'" "$QUTE_URL" >>"$QUTE_FIFO"
yt-dlp --merge-output-format mp4 -f "bestvideo+bestaudio[ext=m4a]/best" --embed-thumbnail --external-downloader aria2c --external-downloader-args "-j 16 -s 16 -x 16 -k 5M" --add-metadata -o "%(title)s.%(ext)s" "$QUTE_URL"
notify-send "QuteBrowser yt-dlp" "Finished downloading audio+video"
}
case "$1" in
"audio")
audio
exit
;;
"audio+video")
audio_video
;;
esac