summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-08 02:13:44 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-02-08 02:13:44 +0900
commit573e00a1ef44dc0bfa7fe8bf102c4185d08d1bae (patch)
tree009c214e5da7dbbd2b5810dd6896b84070f66e60
parent622a9abbcc4ee6719a843cf32c84673553c8637b (diff)
modified bin/mpvplay
-rwxr-xr-xar/.local/bin/mpvplay8
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() {