diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-10 05:04:08 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-10 05:04:08 +0900 |
| commit | db7072e90b9c52c007f5150efc1e11e8d6efc248 (patch) | |
| tree | c11a9b7667c784c14fcb641cc9062d4693cd8aae /ar/.local/bin/qndl | |
| parent | d4a2d0eb17bb3cc9ee7044a7e2cdb22eb8bd2d92 (diff) | |
modified bin/qndl
Diffstat (limited to 'ar/.local/bin/qndl')
| -rwxr-xr-x | ar/.local/bin/qndl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ar/.local/bin/qndl b/ar/.local/bin/qndl index d072522..15d7a43 100755 --- a/ar/.local/bin/qndl +++ b/ar/.local/bin/qndl @@ -4,7 +4,6 @@ case "$BROWSER" in librewolf) cookies="librewolf:~/.librewolf" ;; firefox) cookies="firefox:~/.mozilla/firefox" ;; -*) echo "⛔ Unsupported browser: $BROWSER" && exit 1 ;; esac # [url] [type] [cmd] @@ -26,7 +25,9 @@ fi ! curl --head --silent --fail "$url" >/dev/null && notify-send "⛔ URL is not accessible: $url" && exit 1 # opts -base="yt-dlp --cookies-from-browser $cookies -civ --no-force-overwrites --no-playlist" +[ -n "$cookies" ] && base="yt-dlp --cookies-from-browser $cookies -civ --no-force-overwrites --no-playlist" || + base="yt-dlp -civ --no-force-overwrites --no-playlist" + case $type in -m | --music) downloadtype="music" @@ -101,5 +102,5 @@ notify-send "⏳ Downloading..." "$filename" idnum="$(tsp $cmd -o "$output" "$url")" # done -tsp -D "$idnum" notify-send "👍 Completed download!" "$filename" +tsp -D "$idnum" notify-send "👍 Completed download!" "$filename" || notify-send "❌ Failed to donwload:" "$filename" [ "$downloadtype" = "music" ] && tsp -D "$idnum" "mpc update" |
