summaryrefslogtreecommitdiff
path: root/ar/.local/bin/mpvplay
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-05-25 12:23:59 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-05-25 12:23:59 +0900
commit4433941ae8c43dd1332577ba0ae0fa1e464f442f (patch)
treeca9e8dcd6b75a91f4f88ea0297f12087eacf718b /ar/.local/bin/mpvplay
parenta88ab36de479f49baee0c9cf7f52556ccee35f60 (diff)
modified bin/mpvplayHEADmaster
Diffstat (limited to 'ar/.local/bin/mpvplay')
-rwxr-xr-xar/.local/bin/mpvplay15
1 files changed, 13 insertions, 2 deletions
diff --git a/ar/.local/bin/mpvplay b/ar/.local/bin/mpvplay
index 7a43bd3..ba21740 100755
--- a/ar/.local/bin/mpvplay
+++ b/ar/.local/bin/mpvplay
@@ -76,11 +76,22 @@ loginurl() {
play_url() {
url=$(xclip -selection clipboard -o)
echo "$url" | grep -qE '^https?://' || return 1
- if yt-dlp --simulate --dump-json "$url" >/dev/null 2>&1; then
+
+ # SOOP rebrand: yt-dlp only recognizes sooplive.co.kr / afreecatv.com,
+ # not sooplive.com. Normalize so VOD/live/channel URLs work.
+ url=$(echo "$url" | sed -E 's#(https?://[^/]*\.)sooplive\.com#\1sooplive.co.kr#')
+
+ # Capture stderr so we can tell "needs login" apart from other failures
+ # (e.g. unsupported URL), instead of always prompting for credentials.
+ err=$(yt-dlp --simulate --dump-json "$url" 2>&1 >/dev/null)
+ if [ $? -eq 0 ]; then
notify-send "Playing video from URL:" "$url"
play --ytdl-format="$ytdl_format" "$url"
- else
+ elif echo "$err" | grep -qiE 'log[ -]?in|sign[ -]?in|authenticat|registered user|--username|--cookies|members[- ]?only|private'; then
loginurl
+ else
+ notify-send "Failed to play URL" "${err##*ERROR: }"
+ exit 1
fi
}