switch from youtube-dl to yt-dlp
This commit is contained in:
parent
a93fa19d62
commit
55442ad98e
3 changed files with 6 additions and 4 deletions
|
@ -23,12 +23,12 @@ urls="$(echo $clip | grep -o 'https\?://[a-zA-Z0-9~#%&_+=,.?/-]\+')"
|
||||||
|
|
||||||
# Check the requirements for every option
|
# Check the requirements for every option
|
||||||
opts="fav|rot13"
|
opts="fav|rot13"
|
||||||
check_exists "$TERM_EMU" "mpv" "youtube-dl" &&
|
check_exists "$TERM_EMU" "mpv" "yt-dlp" &&
|
||||||
opts="audio-search|$opts"
|
opts="audio-search|$opts"
|
||||||
check_exists "dragon" &&
|
check_exists "dragon" &&
|
||||||
opts="drag-n-drop|$opts"
|
opts="drag-n-drop|$opts"
|
||||||
# Enable additional features when the clipboard contains an URL
|
# 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
|
if echo "$urls" | grep -qF "scribblehub.com"; then
|
||||||
check_exists "lncrawl" && opts="crawl|$opts"
|
check_exists "lncrawl" && opts="crawl|$opts"
|
||||||
else
|
else
|
||||||
|
|
|
@ -34,10 +34,12 @@ if [ -z "$url" ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_exists yt-dlp || die "yt-dlp not found"
|
||||||
|
|
||||||
[ -d "$dest" ] || mkdir -p "$dest"
|
[ -d "$dest" ] || mkdir -p "$dest"
|
||||||
|
|
||||||
notify-send -t 3000 "mp3dl" "Downloading $url..."
|
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:' \
|
| grep 'ERROR:' \
|
||||||
| notify_err
|
| notify_err
|
||||||
|
|
|
@ -113,5 +113,5 @@ our $CONFIG = {
|
||||||
wget_cmd => "/usr/bin/wget",
|
wget_cmd => "/usr/bin/wget",
|
||||||
youtube_video_url => "https://www.youtube.com/watch?v=%s",
|
youtube_video_url => "https://www.youtube.com/watch?v=%s",
|
||||||
ytdl => 1,
|
ytdl => 1,
|
||||||
ytdl_cmd => "/usr/bin/youtube-dl",
|
ytdl_cmd => "/usr/bin/yt-dlp",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue