From c7208f917800197cacd16c5d3150ba21d89aed77 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Fri, 6 Jun 2025 18:31:26 +0500 Subject: [PATCH] fetch scripts for some channels --- fetchscripts/fetch-all.sh | 9 +++++++++ fetchscripts/madhinalive-to-m3u.sh | 5 +++++ fetchscripts/youtubelive-to-m3u.sh | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100755 fetchscripts/fetch-all.sh create mode 100755 fetchscripts/madhinalive-to-m3u.sh create mode 100755 fetchscripts/youtubelive-to-m3u.sh diff --git a/fetchscripts/fetch-all.sh b/fetchscripts/fetch-all.sh new file mode 100755 index 0000000..e049aae --- /dev/null +++ b/fetchscripts/fetch-all.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 + +echo "return 302 $(./youtubelive-to-m3u.sh dhaaristv);" > ../nginx/redirects/dhaaristv.conf +echo "return 302 $(./youtubelive-to-m3u.sh EmanChannelTV);" > ../nginx/redirects/emanchannel.conf +echo "return 302 $(./youtubelive-to-m3u.sh SaudiQuranTv);" > ../nginx/redirects/makkahlive.conf +echo "return 302 $(./madhinalive-to-m3u.sh);" > ../nginx/redirects/madhinalive.conf +echo "return 302 $(./youtubelive-to-m3u.sh sanguTVMV);" > ../nginx/redirects/sangutv.conf diff --git a/fetchscripts/madhinalive-to-m3u.sh b/fetchscripts/madhinalive-to-m3u.sh new file mode 100755 index 0000000..fcf5712 --- /dev/null +++ b/fetchscripts/madhinalive-to-m3u.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +VIDEO_ID=$(curl -s https://makkahlive.net/madinalive.aspx | grep -o "videoid= '[^']*'" | head -n1| cut -d"'" -f2) + +yt-dlp -g -f b $(echo https://www.youtube.com/watch?v=$VIDEO_ID) diff --git a/fetchscripts/youtubelive-to-m3u.sh b/fetchscripts/youtubelive-to-m3u.sh new file mode 100755 index 0000000..0c68217 --- /dev/null +++ b/fetchscripts/youtubelive-to-m3u.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +CHANNEL_ID="$1" + +VIDEO_ID=$(curl -sL https://www.youtube.com/@$CHANNEL_ID/streams | grep "Tap to watch live" | sed 's/.*\/watch?v=\([^\\]*\).*/\1/') + +yt-dlp -g -f b $(echo https://www.youtube.com/watch?v=$VIDEO_ID)