Since early December 2018, Vader Streams has changed their EPG xml file. This new file includes several tags which are apparently unsupported by the TVH EPG-grabber/parser. Trying to use this downloaded file directly will result in an error that reads htsmsg_xml_deserialize error Unknown syntatic element: <!ELEMENT tv where 'tv' can be any of several tags.
The offending tags must be removed so that the XML file can be parsed by TVH. These tags are ALL at the very beginning of the file. They immediate follow the <!-- DTD for TV... and stop at the ]> line. Here's a sample:
<?xml version="1.0"?>
<!DOCTYPE tv [
<!-- DTD for TV listings http://xmltv.cvs.sourceforge.net/viewvc/xmltv/xmltv/xmltv.dtd -->
<!ELEMENT tv (channel* , programme*)>
<!ATTLIST tv date CDATA #IMPLIED>
<!ATTLIST tv source-info-url CDATA #IMPLIED>
<!ATTLIST tv source-info-name CDATA #IMPLIED>
...
<!ATTLIST review reviewer CDATA #IMPLIED>
<!ATTLIST review lang CDATA #IMPLIED>
]>
<tv source-info-name="" source-info-url="" source-data-url="" generator-info-name="jaylinski/xmltv" generator-info-url="https://github.com/jaylinski/xmltv">
After removal, the beginning of the file should look like this:
<?xml version="1.0"?>
<!DOCTYPE tv [
<!-- DTD for TV listings http://xmltv.cvs.sourceforge.net/viewvc/xmltv/xmltv/xmltv.dtd -->
]>
<tv source-info-name="" source-info-url="" source-data-url="" generator-info-name="jaylinski/xmltv" generator-info-url="https://github.com/jaylinski/xmltv">
A file formatted like this will work in TVH as normal and will populate your EPG as before.
Manually doing this to your downloaded EPG is an option, but not a very good one. We can use a simple script instead to download the file, clean it up and put it somewhere TVH can find it. I've tried to make the script POSIX compliant so it can be run on most any flavour of LINUX.
- Log in to your system via SSH or at the console.
- Download/copy the script to your machine. You can rename the script to anything you like, it doesn't matter.
- Make the script executable
chmod +x scriptname.sh
- You should run the script once manually to make sure everything works properly.
- The script takes two arguments in order to run. If you forget an argument, the script will exit and display a brief usage reminder so you know what you did wrong. The syntax is:
scriptname.sh http://server.tld/filename.ext outputFile.xml
- scriptname.sh -- Whatever you named the script (default is downloadEPG.sh)
- http://server.tld/filename.ext -- This is the URL where the EPG file is located. Currently, for Vader Streams, this is http://vaders.tv/p2.xml
- outputFile.xml -- This is whatever you want the edited XML file containing the EPG to be called. I usually call mine epg.xml. You can supply a full path or just a filename if you want the file saved in the same directory as the script.
- Assuming everything runs correctly with no errors (the script will tell you), you should have an edited file you can use with TVH.
- If you're using KODI, update your TVH service to point to the file you just created. If you're using something else or using TVH to directly access the file, update as necessary to reflect the new filename.
- That's it! It should work for you just as it did before :-)
On pretty much every Linux system, you can set a cron job to run this script and keep your EPG data up-to-date. Here are the steps:
- Make sure you're logged in as root or some other user that is ALWAYS logged in since you need this to run unattended.
- Open your crontab to create/add a new job
crontab -e
- Go to the bottom on the file, add an empty line or two and then add the following: (If your file is empty, that's cool, just add the following)
# Download EPG from Vader Streams at 2:22am every day
22 2 * * * /storage/downloadEPG.sh http://vaders.tv/p2.xml epg.xml >/dev/null 2>&1
Of course, you'll have to customize this to fit your environment. Here's a brief explanation to help you out:
- Edit the comment to say whatever you want. That's the line that starts with #
- "22 2 * * *" means "run every day at 2:22am". If you wanted to run the script at 3:45am, you'd use "45 3 * * *". If you wanted 6:13pm, then you'd go with "13 18 * * *". In other words, it's minute <space> hour <space> then three asterisks. Those three asterisks mean every day of every month each day of the week. Check out https://crontab.guru if you need help making an expression for the time/days you want to run the script.
- My script is located at /storage/downloadEPG.sh since I'm running on LibreElec. Again, you can store the script anywhere that works for your environment.
- Pass the appropriate parameters just like when you ran it manually before.
- >/dev/null 2>&1 means that you don't want any output from the script and no notifications from it. Since it's running unattended, this makes sense. You can copy this part verbatim.
- Save and exit. Accept whatever filename is automatically generated, do NOT change it.
- Verify your crontab has been updated:
crontab -l
You should see your changes appear.
- That's it, your script is set to run at the time you specified.
Make sure you log back into your system via SSH/console the next day or two and check your downloaded EPG file. You should see that the timestamp of the file has been updated, indicating that a new file was downloaded and everything is working.
I think that's it. Hopefully, this was pretty clear. If not, leave a note below and I'll get back to you.
This problem seems resolved on Vaders' end after EPG maintenance. I'll keep this available for a bit longer in case things revert.