XMLTV guide data

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
Post Reply
garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

Okay, so his DVR Service is with the SERVIO purchase. It appears his HDHR3-CC is not currently attached to the service though. Question, can he attach his tuner to the DVR Service? (I would assume so) Also, would the Servio deviceauth need to be included?

signcarver
Expert
Posts: 11083
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10A05954 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 39

Re: XMLTV guide data

Post by signcarver »

you should be able to concatenate all deviceauths (including that of the servio)... the servio/scibe doesn't get a subscription as they currently don't subscribe as they include a year of service that follows device not account (i.e if he sold the servio the rest of the year follows it)... the only way to add the prime would be to actually subscribe.

garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

So even though the Servio has no tuners, because its' DvrActive response is true, then all other devices in the deviceAuth string will have access to the XMLTV data? We only need a single device active to gain access to XMLTV?

nickk
Silicondust
Posts: 20163
Joined: Tue Jan 13, 2004 9:39 am
x 376

Re: XMLTV guide data

Post by nickk »

The SERVIO provides guide access as long as it is included in the DeviceAuth.

If you sell the SERVIO you lose the guide access it was providing and the new owner gets the remaining part of the year of guide included with the SERVIO.

Nick

garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

So that was the root of my problem... I didn't include the deviceAuth from the Servio in the request.

Thank you very much, everyone.

signcarver
Expert
Posts: 11083
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10A05954 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 39

Re: XMLTV guide data

Post by signcarver »

From the first post...
If you have more than one HDHomeRun unit pull the DeviceAuth from each and concatenate them together.

garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

signcarver wrote: Fri Dec 27, 2019 11:28 am From the first post...
If you have more than one HDHomeRun unit pull the DeviceAuth from each and concatenate them together.
Kinda unnecessary, but sure. I did that, but I limited it to tuner devices... not realizing that a Servio will give a blanket authorization to all other devices in the request.

signcarver
Expert
Posts: 11083
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10A05954 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 39

Re: XMLTV guide data

Post by signcarver »

sorry, since only one tuner was involved I couldn't tell and didn't know if you were trying to access on a per device basis for other reasons, I just knew the results showed two devices but only one was used. It just seems like déjà vu since djp952 made the same assumptions prior to september.

garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

I'm getting some results back from some CC users and there's some interesting stuff in the XMLTV file.

Code: Select all

	<channel id="NZ431677.hdhomerun.com">
		<display-name>HGTV</display-name>
		<display-name>30 HGTV</display-name>
		<display-name>30</display-name>
		<lcn>30</lcn>
		<icon src="http://img.hdhomerun.com/channels/NZ431677.png" width="360" height="270"/>
	</channel>

...
	<programme start="20191227233000 +0000" stop="20191228003000 +0000" channel="NZ431677.hdhomerun.com">
		<title>Restored</title>
		<desc>Brett Waterman restores an enormous 1915 Arts and Crafts home for a couple with eight children.</desc>
		<category>Lifestyle</category>
		<category>Renovation</category>
		<icon src="http://img.hdhomerun.com/titles/NZ362960.jpg" width="360" height="270"/>
		<series-id>NZ362960</series-id>
		<episode-num system="dd_progid">NZ971.6854</episode-num>
		<new/>
	</programme>
Other than finding I need to do something special for New Zealand, why is HGTV getting a NZ StationID and a dd_progid that does not follow any numbering convention I am familiar with? There are other channels that get EU station IDs as well, but from I've seen the dd_progid follows the TMS program id convention.

garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

@nickk: I need to understand if I should expect non-Gracenote IDs in the dd_progid even for US stations like I exampled above. Also, Is this what the NZ programmes look like? Are they from a source other than Gracenote? If so, is there a way you could send me a larger sample so I can support them properly? Is this the same for AU programmes?

My HDHR2MXF program looks to be working great, but for stations like above, I have to completely ignore it. Any guidance on this would be appreciated.

Thank you.

nickk
Silicondust
Posts: 20163
Joined: Tue Jan 13, 2004 9:39 am
x 376

Re: XMLTV guide data

Post by nickk »

garyan2 wrote: Mon Dec 30, 2019 10:25 am @nickk: I need to understand if I should expect non-Gracenote IDs in the dd_progid even for US stations like I exampled above. Also, Is this what the NZ programmes look like? Are they from a source other than Gracenote? If so, is there a way you could send me a larger sample so I can support them properly? Is this the same for AU programmes?
You should not be seeing NZ stations in US data. What device ID? I will look into it.

AU and NZ come from Gracenote but from a different system. Everything US/CA/EU/UK should use the Gracenote IDs you are familiar with.

Nick

garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

nickk wrote: Mon Dec 30, 2019 6:59 pmYou should not be seeing NZ stations in US data. What device ID? I will look into it.

AU and NZ come from Gracenote but from a different system. Everything US/CA/EU/UK should use the Gracenote IDs you are familiar with.
It looks like the device is 131125B5.

Thanks for the info on NZ and AU. I'll update my website that they are not supported yet. Also, I didn't mention it, but all the NZ programmes in the xmltv file were flagged as NEW... just found that interesting.

Thank you,
Gary

garyan2
Posts: 64
Joined: Sun Aug 19, 2018 9:36 am
x 4
Contact:

Re: XMLTV guide data

Post by garyan2 »

@nickk : were you able to capture the NZ and EU channels in the XMLTV file for the device? Has this been resolved?

gr33k
Posts: 2
Joined: Mon Nov 30, 2015 9:25 pm

Re: XMLTV guide data

Post by gr33k »

so for those wonder "How the heck do I get this into a xml file on my NAS/Linux server?!"

Code: Select all

curl --compressed http://api.hdhomerun.com/api/xmltv?DeviceAuth=Your25digitkeyinstead > tvlist.xml
Replace Your25digitkeyinstead with your key of course, and tvlist.xml can be whatever file you want to name the output file.

You can make this an easy script and run it via a crontab to periodically run and update the file:

nano myxmltvlistpuller.sh
(or use vi or whatever....it's myscriptname.sh so name it what you want)

in the file put in:

Code: Select all

#!/bin/bash
echo 'Downloading TV Guide Data...'
curl --compressed http://api.hdhomerun.com/api/xmltv?DeviceAuth=Your25digitkeyinstead > tvlist.xml
echo 'Done!'
exit and save (in nano ctrl +x and say yes to save)

then give the file execute permissions:
chmod +x myxmltvlistpuller.sh

and run it
./myxmltvlistpuller.sh

you'll have a tvlist.xml file in that same folder :)

Use Case - I run this in my Jellyfin docker container's config folder directly on my Linux Server (my custom NAS/server/media/etc). I point my xmltv guide path to it and voila :D

gr33k
Posts: 2
Joined: Mon Nov 30, 2015 9:25 pm

Re: XMLTV guide data

Post by gr33k »

Ok...so I got it running, but I realized the key is not static...it seems to change after a while (I don't know how long but at least every day if not sooner you will have a newer key). So I had to modify the script to be able to obtain the key first, and then pass it as a variable to the script each time to successfully download the TVGuide data :?

Well - that appears to be easy enough. You need to have an app called jq (https://stedolan.github.io/jq/) installed though. You should be able to apt install jq or yum install jq for an easy install. With that...here we have:

Code: Select all

#!/bin/bash
echo 'Getting Current Key from HDHomeRun...'
KEY=$(curl http://192.168.10.143/discover.json | jq -r .DeviceAuth)
echo 'Current Key is' $KEY #optional
echo 'Downloading TV Guide Data...'
curl --compressed api.hdhomerun.com/api/xmltv?DeviceAuth=$KEY > xmltvlist.xml
echo 'Done!'
Now of course you have to replace 192.168.10.143 with the IP of YOUR HDHomeRun...but that's about it :mrgreen:

Post Reply