Generate an M3U file from the TRIAX TSS-400 channel list to be used in other software like Kodi,VLC etc

520 views Asked by At

How can I generate an M3U-file from the SAT-IP Receiver TRIAX TSS-400? In the web-GUI of the SAT-Receiver I can only export an XML-file, but this cannot be imported in Kodi, VLC etc.

1

There are 1 answers

0
Carsten On

I ended up writing an Powershell script that finds the TRIAX via UPnP, automatically logs in and creates an M3U-file as needed. Here the script:

# script to generate an M3U file from the TRIAX TSS-400 channel list to be used in other software like Kodi,VLC etc.

cls
$m3uFile = 'c:\temp\triax_channel_list.m3u'

write-host 'reading channel list from TRIAX TSS-400...'
$finder = New-Object -ComObject UPnP.UPnPDeviceFinder
$serverList = $finder.FindByType('urn:schemas-upnp-org:device:MediaServer:1', 0)
$triax = $serverList | where {$_.ModelName -eq 'TSS400'}
$triaxIp = [regex]::Match($triax.PresentationURL, '(?<=//).*?(?=:)').value

$url = "http://$triaxIp/exportChannelList"
$response = Invoke-WebRequest -Uri $url
[xml]$xml = $response.ToString()

$m3u = [System.Collections.Generic.List[string]]::new()
$m3u.Add('#EXTM3U')
foreach($c in $xml.channelTable.channel) {
    $m3u.Add([string]::Concat('#EXTINF:-1,', $c.name))
    $m3u.Add([string]::Concat("http://$triaxIp/dlna/?type=DVB-S-AUTO&src=", $c.src ,'&freq=', $c.freq, '&pol=', $c.pol, '&sr=', $c.sr, '&pids=', $c.pids))
}
$m3u | out-file $m3uFile -Force -Encoding utf8
write-host "file '$m3uFile' was generated."
'done.'