switch from youtube-dl to yt-dlp

This commit is contained in:
lara 2021-11-13 02:44:46 +01:00
parent a93fa19d62
commit 55442ad98e
3 changed files with 6 additions and 4 deletions

View file

@ -23,12 +23,12 @@ urls="$(echo $clip | grep -o 'https\?://[a-zA-Z0-9~#%&_+=,.?/-]\+')"
# Check the requirements for every option
opts="fav|rot13"
check_exists "$TERM_EMU" "mpv" "youtube-dl" &&
check_exists "$TERM_EMU" "mpv" "yt-dlp" &&
opts="audio-search|$opts"
check_exists "dragon" &&
opts="drag-n-drop|$opts"
# Enable additional features when the clipboard contains an URL
if [ -n "$urls" ] && check_exists "youtube-dl"; then
if [ -n "$urls" ] && check_exists "yt-dlp"; then
if echo "$urls" | grep -qF "scribblehub.com"; then
check_exists "lncrawl" && opts="crawl|$opts"
else

View file

@ -34,10 +34,12 @@ if [ -z "$url" ]; then
usage
fi
check_exists yt-dlp || die "yt-dlp not found"
[ -d "$dest" ] || mkdir -p "$dest"
notify-send -t 3000 "mp3dl" "Downloading $url..."
youtube-dl -x --audio-format mp3 --no-playlist --add-metadata -o "$dest/%(title)s.%(ext)s" "$url" 2>&1 \
yt-dlp -x --audio-format mp3 --no-playlist --add-metadata -o "$dest/%(title)s.%(ext)s" "$url" 2>&1 \
| grep 'ERROR:' \
| notify_err

View file

@ -113,5 +113,5 @@ our $CONFIG = {
wget_cmd => "/usr/bin/wget",
youtube_video_url => "https://www.youtube.com/watch?v=%s",
ytdl => 1,
ytdl_cmd => "/usr/bin/youtube-dl",
ytdl_cmd => "/usr/bin/yt-dlp",
}