Jump to content

Parse XML from Channels DVR ....


nyplayer
 Share

Go to solution Solved by redlozenge,

Recommended Posts

  • Solution
redlozenge

I know this isn't ideal, but I solved the issue with the Channels DVR XMLTV listings by making a little python script to parse the "onscreen" field and create an "xmltv_ns" field which Emby will recognize. I scheduled it in cron to run a couple times a day, and I point Emby to this new XML instead.

#!/usr/bin/env python3
import requests 

URL = "http://192.168.1.6:8089/devices/TVE-Suddenlink/guide/xmltv?duration=604800"

tve_xml = requests.get(URL)

xmlOutput = "/var/www/html/xmltv/xmltv_ns.xml"

with open(xmlOutput,"w", encoding="utf8") as fileOut:
    for line in tve_xml.text.splitlines():
        fileOut.write(line+"\n")
        if '<episode-num system="onscreen">' in line:
            season_episode = line.replace('<episode-num system="onscreen">','').replace('</episode-num>','')
            if "S" in season_episode:
                season = ((season_episode.split('S'))[1].split('E'))[0]
                episode = ((season_episode.split('S'))[1].split('E'))[1]
                fileOut.write('    <episode-num system="xmltv_ns">' + str(int(season)-1) + '.' + str(int(episode)-1) + '.</episode-num>\n')

 

 

 

  • Thanks 1
Link to comment
Share on other sites

nyplayer
On 3/9/2021 at 7:57 AM, redlozenge said:

I know this isn't ideal, but I solved the issue with the Channels DVR XMLTV listings by making a little python script to parse the "onscreen" field and create an "xmltv_ns" field which Emby will recognize. I scheduled it in cron to run a couple times a day, and I point Emby to this new XML instead.


#!/usr/bin/env python3
import requests 

URL = "http://192.168.1.6:8089/devices/TVE-Suddenlink/guide/xmltv?duration=604800"

tve_xml = requests.get(URL)

xmlOutput = "/var/www/html/xmltv/xmltv_ns.xml"

with open(xmlOutput,"w", encoding="utf8") as fileOut:
    for line in tve_xml.text.splitlines():
        fileOut.write(line+"\n")
        if '<episode-num system="onscreen">' in line:
            season_episode = line.replace('<episode-num system="onscreen">','').replace('</episode-num>','')
            if "S" in season_episode:
                season = ((season_episode.split('S'))[1].split('E'))[0]
                episode = ((season_episode.split('S'))[1].split('E'))[1]
                fileOut.write('    <episode-num system="xmltv_ns">' + str(int(season)-1) + '.' + str(int(episode)-1) + '.</episode-num>\n')

 

 

 

Great job with this but I have given any hope of seeing this implemented ... I feel that this will go the way of adding EDL support ... I will just use channels dvr.

Link to comment
Share on other sites

6 minutes ago, nyplayer said:

Great job with this but I have given any hope of seeing this implemented ... I feel that this will go the way of adding EDL support ... I will just use channels dvr.

What do you mean?

Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...
On 11/23/2021 at 12:13 PM, nyplayer said:

This has been fixed in the latest Pre-Release of XML from Channels DVR.

What exactly did they change?

Link to comment
Share on other sites

nyplayer
On 11/25/2021 at 7:10 PM, Luke said:

What exactly did they change?

This appears to have been added to XML ... Also Silicondust added it to their XML

<episode-num system="xmltv_ns">24.55.</episode-num>

Edited by nyplayer
Link to comment
Share on other sites

13 hours ago, nyplayer said:

This appears to have been added to XML ... Also Silicondust added it to their XML

<episode-num system="xmltv_ns">24.55.</episode-num>

That's great, thanks for the info.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...