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)