summaryrefslogtreecommitdiff
path: root/scripts/ytdl
diff options
context:
space:
mode:
authorMartial Simon <msimon_fr@hotmail.com>2023-12-13 07:46:56 +0100
committerMartial Simon <msimon_fr@hotmail.com>2023-12-13 07:46:56 +0100
commit09710a3463bc4a90e797d29b4955af1831a84e98 (patch)
treea50ec957130e7573af00fa13af502374edf8c400 /scripts/ytdl
parentbcf8aade269e9fcf6a1a1dcca63d21269f03ae9d (diff)
parent1b7402b9e0d623cab9284aada81fb5429cf662e7 (diff)
Merge branch 'main' of github.com:Laitram31/.config
Diffstat (limited to 'scripts/ytdl')
-rwxr-xr-xscripts/ytdl22
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/ytdl b/scripts/ytdl
index e69cf26..9aafb42 100755
--- a/scripts/ytdl
+++ b/scripts/ytdl
@@ -1,33 +1,33 @@
#!/bin/sh
# wrapper for yt-dlp
-MUSICDIR="${XDG_MUSIC_DIR:-$HOME/Music}"
+MUSICDIR="${XDG_MUSIC_DIR:-$HOME/music}"
VIDEODIR="${XDG_VIDEOS_DIR:-$HOME/Videos}"
case $1 in
v)
mkdir -p "$VIDEODIR"
- notify-send "Video download started"
+ herbe "Video download started"
yt-dlp -f 'bv,ba' -o '%(title)s [%(id)s].%(ext)s'\
-P "$VIDEODIR" "$2" &&
- notify-send "Video downloaded" ||
- (notify-send "Error: No internet connection" && exit 1) ;;
+ herbe "Video downloaded" ||
+ (herbe "Error: No internet connection" && exit 1) ;;
m)
mkdir -p "$MUSICDIR/download"
- notify-send "Music download started"
+ herbe "Music download started"
yt-dlp -f 'ba' -x --embed-thumbnail --audio-format mp3\
-o '%(title)s [%(id)s].%(ext)s' -P "$MUSICDIR/download" "$2" &&
- notify-send "Music downloaded" ||
- (notify-send "Error: No internet connection" && exit 1) ;;
+ herbe "Music downloaded" ||
+ (herbe "Error: No internet connection" && exit 1) ;;
p)
NAME=$(printf '' | dmenu -p 'Name ')
mkdir -p "$MUSICDIR/$NAME"
- notify-send "Playlist download started"
+ herbe "Playlist download started"
yt-dlp -f 'ba' -x --embed-thumbnail --audio-format mp3\
-o '%(playlist_index)s - %(title)s [%(id)s].%(ext)s'\
-P "$MUSICDIR/$NAME" "$2" &&
- notify-send "Playlist downloaded" ||
- (notify-send "Error: No internet connection" && exit 1) ;;
+ herbe "Playlist downloaded" ||
+ (herbe "Error: No internet connection" && exit 1) ;;
*)
exit 1 ;;
-esac \ No newline at end of file
+esac