Spoiler anzeigen
Code$ channels=$(curl -L 'https://sweez.tv/api/mobile/channels' | jq -r '.[].channel_epg'); echo '#EXTM3U' > playlist.m3u8; for c in $channels; do echo '#EXTINF:-1,'$c >> playlist.m3u8; echo pipe://ffmpeg -loglevel fatal -i "https://viamotionhsi.netplus.ch/live/eds/$c/browser-dash/$c.mpd" -ignore_unknown -c:a copy -c:v copy -f mpegts -metadata service_name="$c" pipe:1 >> playlist.m3u8; done
Oder auch als PowerShell...
Spoiler anzeigen
# Fetch the channels data
$data = (Invoke-WebRequest -Uri 'https://sweez.tv/api/mobile/channels').Content | ConvertFrom-Json
# Extract information
$channels = $data | ForEach-Object { $_.channel_epg }
$names = $data | ForEach-Object { $_.channel_name }
$langs = $data | ForEach-Object { $_.channel_language }
$logos = $data | ForEach-Object { $_.channel_image }
$chnumbers = $data | ForEach-Object { $_.channel_number }
# Create the playlist file
"#EXTM3U" | Out-File -FilePath "playlist.m3u8" -Encoding utf8
# Loop through and append to the playlist
for ($i = 0; $i -lt $channels.Count; $i++) {
$name = $names[$i]
$channel = $channels[$i]
$lang = $langs[$i]
$logo = $logos[$i]
$chnumber = $chnumbers[$i]
"#EXTINF:-1 tvg-id=`"$channel`" tvg-chno=`"$chnumber`" group-title=`"$lang`" tvg-logo=`"$logo`", $name" | Out-File -FilePath "playlist.m3u8" -Append -Encoding utf8
"https://viamotionhsi.netplus.ch/live/eds/$channel/browser-HLS8/$channel.m3u8" | Out-File -FilePath "playlist.m3u8" -Append -Encoding utf8
}