From 616fa190d3b2968d7623fbf0cf1037f9017e7070 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Tue, 1 Jul 2025 03:54:45 +0900 Subject: modified zsh/scripts.zsh, modified bin/qndl --- ar/.config/zsh/scripts.zsh | 8 +++----- ar/.local/bin/qndl | 9 +++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ar/.config/zsh/scripts.zsh b/ar/.config/zsh/scripts.zsh index 6c217e8..81ab402 100644 --- a/ar/.config/zsh/scripts.zsh +++ b/ar/.config/zsh/scripts.zsh @@ -449,11 +449,9 @@ function fzf_kill_process() { --bind 'F2:toggle-preview' | awk '{print $2}' | xargs -r bash -c ' - if ! kill "$1" 2>/dev/null; then - if ! kill -9 "$1"; then - echo "Regular kill failed. Attempting with sudo..." - sudo kill "$1" || echo "Failed to kill process $1" >&2 - fi + if ! kill -9 "$1" 2>/dev/null; then + echo "Regular kill failed. Attempting with sudo..." + sudo kill -9 "$1" || echo "Failed to kill process $1" >&2 fi ' -- } diff --git a/ar/.local/bin/qndl b/ar/.local/bin/qndl index f762568..5b96155 100755 --- a/ar/.local/bin/qndl +++ b/ar/.local/bin/qndl @@ -1,12 +1,17 @@ #!/bin/sh ytdl_cmd_base="yt-dlp --continue --embed-metadata --ignore-errors --no-force-overwrites --no-playlist --verbose" +simulation_cmd="yt-dlp --simulate --print %(filename)s" case "$BROWSER" in *firefox*) cookies="firefox" ;; +*librewolf*) cookies="firefox:~/.librewolf/$USER.default" ;; +*qutebrowser*) cookies="chromium:~/.local/share/qutebrowser" ;; esac -[ -n "$cookies" ] && ytdl_cmd_base="$ytdl_cmd_base --cookies-from-browser $cookies" +[ -n "$cookies" ] && + ytdl_cmd_base="$ytdl_cmd_base --cookies-from-browser $cookies" && + simulation_cmd="$simulation_cmd --cookies-from-browser $cookies" shift $((OPTIND - 1)) @@ -101,7 +106,7 @@ case $url in ;; esac -simulation_cmd="yt-dlp --simulate --print %(filename)s $url" +simulation_cmd="$simulation_cmd $url" ytdl_cmd="$ytdl_cmd_base --output \"$ytdl_output_format\" \"$url\"" # Notify and perform simulation to get filename (feedback to user) -- cgit v1.2.3