(UK user) Using Schedules Direct for EPG.
Added by A L over 7 years ago
Hi,
I have finally got TVH up and running and it is very stable and quick - really impressive.
The only thing I am struggling with at the moment is the automatic OTA EPG grabbing, which is not particularly good in the UK (in particular, the missing Season and Episode numbers).
I am currently using Schedules Direct on NPVR and the information provided by them is fantastic - is there any way I can import that same data into TVH instead?
Replies (16)
RE: (UK user) Using Schedules Direct for EPG. - Added by Joe User over 7 years ago
K Shea shared a link which should help...
[[https://tvheadend.org/boards/12/topics/24027?r=24583#message-24583]]
also mentioned in this thread: [[https://tvheadend.org/boards/12/topics/20770]]
RE: (UK user) Using Schedules Direct for EPG. - Added by A L over 7 years ago
Thank you for that.
As a Linux beginner, this is all a bit confusing but I am beginning to get the picture now.
I originally looked at XMLTV but it turns out that my particular distro (based upon Jessie) does not support the latest version (xmltv-utils 0.5.69). The version that I would be stuck with (0.5.63-2) does not have any sdjson grabbers.
It seems that my only alternative is to use mc2xml.
Could anyone perhaps give me a walkthrough as to how to get this installed and set up please? I read the instructions on the website, for Linux installation, but I am just not knowledgeable enough (yet) to realise what I need to do.
RE: (UK user) Using Schedules Direct for EPG. - Added by Joe User over 7 years ago
Sorry, I do not have time to make detailed instructions, but the link I pointed to should help to setup the tvheadend side.
I never used mc2xml (I use zap2it) but basically you need to download the linux script and play with the command line options until you get what you need. Then make sure you use the "-o" option to save it to "/home/hts/.xmltv/tv_grab_file.xmltv".
so something like:
mc2xml -c gb -g "SW1X 7LA" -o
Once that works, you need to make a cron entry to run it regularly. I use:
02 4 * * * hts /home/hts/zap2xml.pl -u user -p pass -o /home/hts/.xmltv/tv_grab_file.xmltv
(obviously changing to mc2xml and setting correct options...)
This runs every day at 04:02 , and then in tvheadend, I set the internal grabber cron entry to:
15 4 * * *
which runs everyday at 04:15. Should be enough time for the download to finish.
RE: (UK user) Using Schedules Direct for EPG. - Added by A L over 7 years ago
Thanks ever so much for that.
Out of interest - what is the difference between XMLTV, mc2xml and zap2xml?
RE: (UK user) Using Schedules Direct for EPG. - Added by Robert Cameron over 7 years ago
A L wrote:
Thanks ever so much for that.
Out of interest - what is the difference between XMLTV, mc2xml and zap2xml?
XMLTV is the format of the file. The project that maintains the XMLTV specifications (DTD/XSD) also publishes perl-based utilities for multiple services.
Zap2xml was originally to pull guide information from the Zap2It site, and later TVGuide. It too is written in perl.
Mc2xml was originally written to pull data used by Windows Media Center and output it to XMLTV, IIRC.
The later 2 have changed much from their original purpose and are general purpose grabbers for a variety of sources now. Whichever you use is up to you. As long as they obey the XMLTV spec and conform to the standard commands and options used by the XMLTV projects grabbers they can be used as internal grabbers with Tvheadend.
If their options/output do not match the expected output, a wrapper script can be used. Similarly, a cronjob with the grabbers paired with netcat/socat can write directly to a socket for Tvheadend which is what Tvheadend's "external XMLTV" support is.
RE: (UK user) Using Schedules Direct for EPG. - Added by Philip Jeffery over 7 years ago
I'd be interested to hear how you are getting on with Schedules Direct, I'm in the UK and also just setup TVHeadend, I'm using the OTA Guide at the moment and struggling with the metadata data, my recording filenames include the Title and Subtitle that results in a very long filename (Although the Season/Episode data does appear on some program descriptions).
I'm hoping that by using Schedules Direct I'd be able to get the Title and Season/Episode metadata as a filename, then get the recording picked up automatically by Kodi.
Is this possible?
RE: (UK user) Using Schedules Direct for EPG. - Added by Fet Fer over 7 years ago
I am a UK user.
I use the windows version of mc2xml to create my XML file then transfer it over to where it is needed.
My base system for Kodi/TVHeadend is Libreelec
I have TVHeadend Digital Video Recorder profile for TV Shows which has these settings for filenames;
Include Episode In Filename:,
Put Episode In Filename Before Date And Time: (possibly not needed as I do not include date & time anymore),
Include Subtitle In Filename:,
Remove All Unsafe Characters From Filename:.
I get filenames such as: "_Agatha Christie_s Marple.S05E02.The Secret of Chimneys_"
You can get files without series and episode which can be a pain if there is no Subtitle but they just get a number appended to them as they are recorded. You can include Date and Time to make them unique if you prefer.
Additionally in the Subdirectory options I have Make Subdirectories Per Title: so for example the above file is in the Agatha Christie_s Marple subdirectory.
You can point Kodi at the TV Recordings directory to use these directly rather than using the TVHeadend PVR.
I have a separate folder for TV, Film, Radio and Default which are defined in separate Video Recorder profiles' Recording System Path:.
By doing this you can define media types to Film and TV to use Kodi to gather more info.
I hope this helps.
RE: (UK user) Using Schedules Direct for EPG. - Added by Fet Fer over 7 years ago
I just remembered I pretty much finished a doc for my TvHeadend installation which was originally on Openelec. It is based on Kodi 16 but might be useful.
RE: (UK user) Using Schedules Direct for EPG. - Added by Philip Jeffery over 7 years ago
Thanks for this, I've made a bit more progress with my setup and thought i might share.
Is there a specific reason you're using mc2xml then doing over? I've installed xmltv scripts to pull the guide data from schedules direct, I had to copy over the tv_grab_sd_json version manually to get it to work.
I'm using the same filename settings and can point kodi at the folder which is working alright, but i have one snag. TV shows and movies end up in the same folder causing odd results in kodi. I've been given a tip to use the category field to create subdirectories, but I need tvheadend 4.1 and my content types don't seem very accurate at the moment, do you have problems with these?
RE: (UK user) Using Schedules Direct for EPG. - Added by Fet Fer over 7 years ago
I Download once using mc2xml and distribute to multiple boxes.
I use the TVHeadend web interface to schedule series recordings and specific films so I can use different Recorder profiles (I use TVHeadend v4.0 and have no experience with 4.1).
The Kodi epg does not have the facility to use the profiles when selecting to record, it simply uses the (Default Profile) one, which is fine for the odd one off recording.
You can of course edit any timer setup by Kodi afterwards to change the Profile, using the web interface, but this is not ideal.
RE: (UK user) Using Schedules Direct for EPG. - Added by A L over 7 years ago
Philip Jeffery wrote:
I'd be interested to hear how you are getting on with Schedules Direct, I'm in the UK and also just setup TVHeadend, I'm using the OTA Guide at the moment and struggling with the metadata data, my recording filenames include the Title and Subtitle that results in a very long filename (Although the Season/Episode data does appear on some program descriptions).
I'm hoping that by using Schedules Direct I'd be able to get the Title and Season/Episode metadata as a filename, then get the recording picked up automatically by Kodi.
Is this possible?
To tell you the truth - I am really struggling with everything at the moment. I really wanted to leave Windows behind but Linux is just so difficult to use.
I tried to persevere with XMLTV but, having tried to compile it for Debian Jessie (having spent literally weeks), I have had to just give up and try mc2xml.
However, I am still struggling with even this.
I would really appreciate an absolute idiot's guide to setting up mc2xml on my server, to allow me to get Schedules Direct EPG date into TVH.
RE: (UK user) Using Schedules Direct for EPG. - Added by Philip Jeffery over 7 years ago
I've managed to get the xmltv grabber working fairly well so can try and help. It will take sometime to write up so might need to wait until tomorrow.
Can you provide some detail where you got to with xmltv?
RE: (UK user) Using Schedules Direct for EPG. - Added by A L over 7 years ago
Thanks mate - really appreciate it.
What distro do you have TVH installed on?
RE: (UK user) Using Schedules Direct for EPG. - Added by Philip Jeffery over 7 years ago
I'm using a raspberry pi with osmc, this is based on debian and you can install tvheadend very easily. I've also used mythbuntu in the past so gone through the same pain learning how to use Linux, but got to grips with it eventually.
RE: (UK user) Using Schedules Direct for EPG. - Added by A L over 7 years ago
Code:
sudo apt-get install libxml-treepp-perl
Code:
sudo apt-get install bzip2
Code:
sudo wget https://sourceforge.net/projects/xmltv/files/xmltv/0.5.69/xmltv-0.5.69.tar.bz2
Code:
tar xvf xmltv-0.5.69.tar.bz2
Code:
cd xmltv-0.5.69/
Code:
root@openmediavault:~/xmltv-0.5.69# perl Makefile.PL
Can't locate Term/ReadKey.pm in @INC (you may need to install the Term::ReadKey module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/site_perl .) at lib/Ask/Term.pm line 9.
BEGIN failed--compilation aborted at lib/Ask/Term.pm line 9.
Compilation failed in require at Makefile.PL line 254.
Code:
apt-get install libterm-readkey-perl
Code:
make
RE: (UK user) Using Schedules Direct for EPG. - Added by Philip Jeffery over 7 years ago
So I didn't need to compile XMLTV to get it to work - simply used:
sudo apt-get install xmltv
There is a Jessie Build: https://packages.debian.org/jessie/xmltv
This is a slightly different version to the one your trying to build, but I'm using 0.5.63 so I'm sure that shouldn't be a problem.
Probably need to make sure we get xmltv installed first before anything else, but if that does work try the following.
Use this to list all the grabbers that are installed, you're looking for tv_grab_sd_json:tv_find_grabbers baseline manualconfig
The grabber didn't come with the package for me so I simply downloaded the latest version from here: https://github.com/kgroeneveld/tv_grab_sd_json then copied the file to /usr/bin/. If you have the same problem and need to copy the file over make sure the permissions are the same as the other grabber files (Majority of the problems I have with Linux are permissions based, once you know that they can be fairly easy to fix: https://help.ubuntu.com/community/FilePermissions)
Once you've got everything installed you can configure the grabber, I just used the steps available here: https://www.mythtv.org/wiki/Migrating_to_Schedules_Direct_in_the_UK#Configure_your_feeds_for_the_first_time
I can't remember what questions crop up during configuration but I think I used the default ones when required, post any here if you need to. My one top tip is don't download all the channels it takes longer and you probably don't want all the channels anyway.
Hopefully if all that works well you should be able to create an xml file that contains the epg data, the next step is getting the data into Tvheadend.
I struggled with this bit, but think restarting Tvheadend was the answer in the end, so following these steps should help:
- Restart Tvheadend
- Go into the Configuration > Channel/EPG > EPG Grabber
- Under the internal grabber section you should hopefully see the option "XMLTV: Schedules Direct JSON API"
- I didn't touch the CRON multi-line settings
- All the other sections are disabled
- I think the grabber started automatically pulling the data, if that doesn't work you can change the CRON multi-line settings to run: http://docs.tvheadend.org/webui/config_epggrab/#cron-multi-line-config-text-areas
- Then go to Configuration > Channel/EPG > Channels
- You'll need to go through each channel and change the EPG Source to the XMLTV grabber.
- Hopefully you'll start to see the Schedules Direct data coming into the EPG
Let me know how you get on, sounds like the install is the frustrating bit, once you get that sorted the rest should be straight forward.