I’ve used Kodi (xbmc) as frontend for my DVBLogic (DVBLink) TV-Server backend. Which is working great, but I wanted to enhance the experience a bit and get channel logos for all my channels to show in the tv-listing and in EPG view.
There were unfortunately no packs of Swedish channel logos available, so I made a small powershell script that reads the channel logo URL’s from the EPG Guides and downloads them to a country specific folder. They can then be assigned in DVBLink to the right channels.
The part that took the longest to make was to find a way to download the latest Windows (Win32) version of XMLTV from Sourceforge.
The Script is Downloading Windows (Win32) version on XMLTV.exe from Sourceforge https://sourceforge.net/projects/xmltv/
It’s then unpacking the Zip file to a Directory in c:\temp\xmltv
It will run XMLTV.EXE with –configure where you will be prompted for a location of the cache and which Channels to download information for. Either manually select each channel you want logos for or select all.
XMLTV.EXE will in the next step download information to tvzon.xml. I’ve set the timespan to 0, to make the download size minimal. Meaning, if you want more EPG data, you may want to change “–days 0” to “–days 14”.
The Script is then rading tvzon.xml and downloads all Logos to a country specific folder, based on the filename.
You can now copy the folder structure into your DVBLink server installation under “Program Files (x86)\DVBLogic\DVBLink\share\channel_logos” and you can keep the folder structure.
Link if you just want to download my pack: https://www.dropbox.com/s/elmoomsiyahxc4q/SwedishChannelLogos.zip?dl=0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# XMLTV files to grab run "xmltv.exe" to find out which ones are available. # or check http://wiki.xmltv.org/index.php/XMLTVProject $tvgrab = "tv_grab_se_tvzon" # Make folders New-Item -Path "c:\temp" -ItemType Directory -ErrorAction SilentlyContinue New-Item -Path "$Destination" -ItemType Directory -ErrorAction SilentlyContinue # Grab latest version of XMLTV from Sourceforge $latestdownload = "https://sourceforge.net/projects/xmltv/files/latest/download?source=files" $downloadfile = Invoke-WebRequest -Uri $latestdownload $filename = ($downloadfile.Links | where class -like direct-download | select -first 1 -ExpandProperty href).split("/?") | foreach { if ($_ -like "xmltv-*-win32.zip") { $_ } } Invoke-WebRequest ($downloadfile.Links | where class -like direct-download | select -first 1).href -OutFile "$Destination\$filename" -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::FireFox -Verbose # Extract Files from archive. Add-Type -assembly "system.io.compression.filesystem" [io.compression.zipfile]::ExtractToDirectory("$Destination\$filename", $destination) $xmltvdir = get-childitem $Destination | where Name -like xmltv-*-win32 | where Mode -Like d* | select -first 1 cd $xmltvdir.FullName # Configure XMLTV and Download EPG Data $xmltvargs = "$tvgrab --configure --config-file $($xmltvdir.FullName)\.xmltv\$($tvgrab).conf" $xmlconfig = Start-Process -FilePath ".\xmltv.exe" -argumentlist "$xmltvargs" -Wait $xmltvargs = "$tvgrab --config-file $($xmltvdir.FullName)\.xmltv\$($tvgrab).conf --days 0 --output $($xmltvdir.FullName)\tvzon.xml" $xmlconfig = Start-Process -FilePath ".\xmltv.exe" -argumentlist "$xmltvargs" -WorkingDirectory $($xmltvdir.FullName) -Wait # Read TVZon.XML file $xml = New-Object xml $xml.Load("$($xmltvdir.FullName)\tvzon.xml") # Select all Channels with a Logo-url defined. $logos = $xml.tv.channel | where icon -notlike "" | select -ExpandProperty icon New-Item -Path "$Destination\logos" -ItemType Directory -ErrorAction SilentlyContinue # Download all Logos and put them in the right directory. foreach ($logo in $logos) { $outlogo = ($logo.src.Split("/")) | select -last 1 $country = $outlogo.split(".")[-2] $direxists = test-path "$Destination\logos\$country" if ($direxists -eq $false) { new-item -Path "$Destination\logos\$country" -ItemType Directory -ErrorAction SilentlyContinue } Invoke-WebRequest $logo.src -OutFile "$Destination\logos\$country\$outlogo" } Write-host "Done!" Write-host "Your Logos are placed in $Destination\logos\$country\" |