This line in ~/.newsboat/config
will allow for hitting “,d” to download the current link with dl.sh
which wraps yt-dlp
.
macro d set browser "~/bin/dl.sh %u 2>&1 >/dev/null &" ; open-in-browser ; set browser "xdg-open %u"
Here’s an example dl.sh
file that uses notify-send
so you know something is going to happen in the background and as a chance to cancel the operation. It downloads videos to ~/Videos/Downloads. Modify to taste!
#!/bin/bash
if [[ "no" != $(notify-send --app-name="yt-dlp" \
--urgency=low \
--transient "Starting download for $1" \
--action=no="Nevermind!") ]]; then
yt-dlp --sponsorblock-remove all \
--live-from-start \
--output "~/Videos/Downloads/%(title)s - %(channel)s (%(id)s).%(ext)s" "$1"
else
printf "Aborted.\n"
exit 1
fi
NOTE: if you close newsboat it will also stop the yt-dlp process.
You must log in or register to comment.