From 55442ad98e02f9e0ad3c711d38d375fd38c82f56 Mon Sep 17 00:00:00 2001 From: lara Date: Sat, 13 Nov 2021 02:44:46 +0100 Subject: [PATCH] switch from youtube-dl to yt-dlp --- bin/cliplumber | 4 ++-- bin/mp3dl | 4 +++- config/pipe-viewer/pipe-viewer.conf | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/cliplumber b/bin/cliplumber index f2f3576..e557efd 100755 --- a/bin/cliplumber +++ b/bin/cliplumber @@ -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 diff --git a/bin/mp3dl b/bin/mp3dl index d77f55b..fcfe765 100755 --- a/bin/mp3dl +++ b/bin/mp3dl @@ -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 diff --git a/config/pipe-viewer/pipe-viewer.conf b/config/pipe-viewer/pipe-viewer.conf index 7e1a982..7ad7d6f 100755 --- a/config/pipe-viewer/pipe-viewer.conf +++ b/config/pipe-viewer/pipe-viewer.conf @@ -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", }