summaryrefslogtreecommitdiff
path: root/ar
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-04 03:43:09 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-04 03:43:09 +0900
commit12045f8ec85fbef17497be4f12799cc714aa9980 (patch)
tree35b1433c13f11757d2734cc927e8f59cf97c401a /ar
parent5904619dbdb31e7db2299553f6483fe4c8099ccb (diff)
modified bin/qndl
Diffstat (limited to 'ar')
-rwxr-xr-xar/.local/bin/qndl30
1 files changed, 15 insertions, 15 deletions
diff --git a/ar/.local/bin/qndl b/ar/.local/bin/qndl
index afcd16e..54490d6 100755
--- a/ar/.local/bin/qndl
+++ b/ar/.local/bin/qndl
@@ -18,6 +18,21 @@ while getopts "mvr" opt; do
YTDL_OUTPUT_FORMAT="${OUTPUT_DIR}/%(artist|)s%(artist& - |)s%(title)s.%(ext)s"
YTDL_CMD_BASE="$YTDL_CMD_BASE --audio-format best --audio-quality 0 --download-archive \"$ARCHIVE_FILE\" --extract-audio --recode-video mp3"
;;
+ r)
+ OUTPUT_DIR="${XDG_MUSIC_DIR:-${HOME}/Music}"
+ ARCHIVE_FILE="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/default/Music/.music.txt"
+ YTDL_OUTPUT_FORMAT="${OUTPUT_DIR}/%(artist|)s%(artist& - |)s%(title)s.%(ext)s"
+ YTDL_CMD_BASE="$YTDL_CMD_BASE --audio-format best --audio-quality 0 --extract-audio --recode-video mp3"
+ YTDL_CMD="$YTDL_CMD_BASE --output \"$YTDL_OUTPUT_FORMAT\""
+ [ ! -f "$ARCHIVE_FILE" ] && exit 1
+ while read -r line; do
+ video_id=$(echo "$line" | awk '{print $2}')
+ YTDL_CMD="$YTDL_CMD_BASE --output \"$YTDL_OUTPUT_FORMAT\" \"https://www.youtube.com/watch?v=$video_id\""
+ idnum=$(tsp bash -c "$YTDL_CMD")
+ pkill -RTMIN+21 "${STATUSBAR:-dwmblocks}"
+ done <"$ARCHIVE_FILE"
+ exit 0
+ ;;
v)
DOWNLOAD_TYPE="video"
OUTPUT_DIR="${XDG_VIDEOS_DIR:-${HOME}/Videos}"
@@ -43,21 +58,6 @@ while getopts "mvr" opt; do
esac
YTDL_CMD_BASE="$YTDL_CMD_BASE --buffer-size 1M --embed-thumbnail $VIDEO_FORMATS --no-sponsorblock $VIDEO_OPTIONS"
;;
- r)
- OUTPUT_DIR="${XDG_MUSIC_DIR:-${HOME}/Music}"
- ARCHIVE_FILE="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/default/Music/.music.txt"
- YTDL_OUTPUT_FORMAT="${OUTPUT_DIR}/%(artist|)s%(artist& - |)s%(title)s.%(ext)s"
- YTDL_CMD_BASE="$YTDL_CMD_BASE --audio-format best --audio-quality 0 --extract-audio --recode-video mp3"
- YTDL_CMD="$YTDL_CMD_BASE --output \"$YTDL_OUTPUT_FORMAT\""
- [ ! -f "$ARCHIVE_FILE" ] && exit 1
- while read -r line; do
- video_id=$(echo "$line" | awk '{print $2}')
- YTDL_CMD="$YTDL_CMD_BASE --output \"$YTDL_OUTPUT_FORMAT\" \"https://www.youtube.com/watch?v=$video_id\""
- idnum=$(tsp bash -c "$YTDL_CMD")
- pkill -RTMIN+21 "${STATUSBAR:-dwmblocks}"
- done <"$ARCHIVE_FILE"
- exit 0
- ;;
*)
notify-send "⛔ Invalid option: -$OPTARG"
exit 1