diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-08 02:13:44 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-02-08 02:13:44 +0900 |
| commit | 573e00a1ef44dc0bfa7fe8bf102c4185d08d1bae (patch) | |
| tree | 009c214e5da7dbbd2b5810dd6896b84070f66e60 | |
| parent | 622a9abbcc4ee6719a843cf32c84673553c8637b (diff) | |
modified bin/mpvplay
| -rwxr-xr-x | ar/.local/bin/mpvplay | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ar/.local/bin/mpvplay b/ar/.local/bin/mpvplay index b375f62..294d59e 100755 --- a/ar/.local/bin/mpvplay +++ b/ar/.local/bin/mpvplay @@ -11,7 +11,13 @@ play_url() { url=$(xclip -selection clipboard -o) [ -n "$url" ] && echo "$url" | grep -E '^https?://' >/dev/null || return 1 notify-send "📽️ Playing video from URL:" "$url" - mpv "$url" || exit + if ! mpv "$url"; then + notify-send "🔑 Authentication required" + username="$(echo | dmenu -i -p "Enter a username:")" + password="$(echo | dmenu -i -P -p "Enter a password:")" + [ -n "$username" ] && [ -n "$password" ] && mpv --ytdl-raw-options=username="$username",password="$password" "$url" || + notify-send "❌ Failed to play $url" "❗ Check your username or password" + fi } play_media() { |
