From 6a4907cd39e0741acb4b9dde82d40ff9a2420173 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:06:35 +0900 Subject: modified qutebrowser/config.py, modified bin/qndl --- ar/.config/qutebrowser/config.py | 4 ++-- ar/.local/bin/qndl | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ar/.config/qutebrowser/config.py b/ar/.config/qutebrowser/config.py index e702c00..b0e911a 100644 --- a/ar/.config/qutebrowser/config.py +++ b/ar/.config/qutebrowser/config.py @@ -2421,8 +2421,8 @@ config.bind("", "cmd-set-text :") # config.bind('{{', 'navigate prev -t') # config.bind('}}', 'navigate next -t') -config.bind(",d", "qndl -v {url}") -config.bind(",D", "hint links qndl -v {hint-url}") +config.bind(",d", "spawn qndl -v {url}") +config.bind(",D", "hint links spawn qndl -v {hint-url}") config.bind(",m", "spawn mpv -quiet --loop {url}") config.bind(",M", "hint links spawn mpv -quiet --loop {hint-url}") config.bind(",v", "spawn umpv {url}") diff --git a/ar/.local/bin/qndl b/ar/.local/bin/qndl index 0dd7263..cc957b5 100755 --- a/ar/.local/bin/qndl +++ b/ar/.local/bin/qndl @@ -3,8 +3,8 @@ YTDL_CMD_BASE="yt-dlp --continue --embed-metadata --ignore-errors --no-force-overwrites --no-playlist --verbose" case "$BROWSER" in -librewolf) cookies="librewolf:~/.librewolf" ;; -firefox) cookies="firefox:~/.mozilla/firefox" ;; +*librewolf*) cookies="librewolf:~/.librewolf" ;; +*firefox* | *qutebrowser*) cookies="firefox:~/.mozilla/firefox" ;; esac [ -n "$cookies" ] && YTDL_CMD_BASE="$YTDL_CMD_BASE --cookies-from-browser $cookies" @@ -27,14 +27,14 @@ fi # Process command-line options for download type case $type in -m) +-m | --music | m | music) DOWNLOAD_TYPE="music" 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 --download-archive \"$ARCHIVE_FILE\" --extract-audio --recode-video mp3" ;; -r) +-r | --restore | r | restore) 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" @@ -49,7 +49,7 @@ r) done <"$ARCHIVE_FILE" exit 0 ;; -v) +-v | --video | v | video) DOWNLOAD_TYPE="video" OUTPUT_DIR="${XDG_VIDEOS_DIR:-${HOME}/Videos}" YTDL_OUTPUT_FORMAT="${OUTPUT_DIR}/%(title)s [%(id)s].%(ext)s" @@ -119,9 +119,8 @@ idnum=$(tsp bash -c "$YTDL_CMD") pkill -RTMIN+21 "${STATUSBAR:-dwmblocks}" # Notify upon completion -filename=$(yt-dlp -s -O '%(filename)s [%(ids)s].%(ext)s' "$URL") -tsp -D "$idnum" notify-send "✅ $DOWNLOAD_TYPE download complete:" "$filename" || - notify-send "❌ Faild to download:" "$filename" +tsp -D "$idnum" notify-send "✅ $DOWNLOAD_TYPE download complete:" "$URL" || + notify-send "❌ Faild to download:" "$URL" # Conditionally update the music database if the download type is music [ "$DOWNLOAD_TYPE" = "music" ] && tsp -D "$idnum" bash -c "mpc update" -- cgit v1.2.3