From 75e7744f01d20afedcc081c91833f851866ccd43 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Thu, 10 Oct 2024 11:33:27 +0200 Subject: [PATCH] startmpv: support rumble by first starting yt-dlp separately --- .local/bin/tools/startmpv | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.local/bin/tools/startmpv b/.local/bin/tools/startmpv index 83632cf..43f5c88 100755 --- a/.local/bin/tools/startmpv +++ b/.local/bin/tools/startmpv @@ -14,6 +14,17 @@ if echo "$1" | grep -qE 'youtube.*list'; then sed 's/^/https:\/\/www.youtube.com\/watch?v=/' | xargs mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' || notify-send "startmpv" "An error has occured with playlist $playlist_id" +elif echo "$1" | grep -qE 'rumble.com'; then + notify-send "startmpv" "Rumble videos are not supported by mpv, first ripping, then playing..." + ( + cd /tmp + yt-dlp "$1" & + # get the filename of the downloaded video + filename="$(yt-dlp -e "$1")" + sleep 5 + mpv /tmp/$filename*part + rm /tmp/$filename*part + ) else mpv --ytdl-format='bestvideo[ext=mp4][width<=1920][height<=1080]+bestaudio[ext=m4a]/best[ext=mp4]/best' "$1" fi