SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV EPG Service

Notices

SageTV EPG Service Discussion related to the SageTV EPG Service used within SageTV. Questions about service area coverage, channel lineups, EPG listings, XMLTV, or anything else related to the service or programming guide data for SageTV should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-13-2022, 09:07 AM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 143
Updated XMLTV Plugin with compile steps

In an effort for some IPTV channels I am working for importing into SageTV I updated the plugin for more use cases. The changes below should work with most XMLTV grabbers. Also for future development there are easy steps for compiling the plugin on the Unraid Docker image. The Unraid Docker Image already has the required java_jdk installed for compiling. In the future I might look into the the ICON working as the data is also stored inside the XMLTV file.

(Warning me venting)
The original was not touched since the beginning of SageTv and impossible to use without remapping or using scripting for remapping channels. It is almost like the developers of SageTV wanted everyone to use their guide data or SD. As for SD the plus is that it gives 2 weeks of data with more info than XMLTV grabbers thus being a good value. Also to be fair to SageTV they also did give a good run(~15 years) with their guide data. Any case with SageTV on its last leg this needs to change as other DVR development have XMLTV native. Viva La SageTV

1. Stop SageTV Server
2. Rename on add/modify/ xmltv_EXAMPLE.properties examples
3. Copy all files and folder contents(not folder) of folder SAGETV_SERVER_ROOT to SageTV folder. Only Jar and *.proerties are required if not compiling required
4. Add the following line in Sage.properties epg/epg_import_plugin=xmltv.XMLTVImportPlugin
5. Start SageTV Server
6. Monitor in server folder xmltv.log, sagetv_0.txt,Sage.properties. If epg/epg_import_plugin=xmltv.XMLTVImportPlugin is removed from Sage.properties something is installed not correctly
7. In SageTV guide setup use XMLTV with zipcode 00000. If ask for license use TRIAL


#######Commnds for UnRaid Docker to Moditfy Sage.properties for Plugin
# Stop Sage Server
sudo -E "PATH=$PATH" -u sagetv /usr/local/bin/stopsage &
# Property Setting for EPG Plugin
sudo sed -i 'epg/epg_import_plugin' /opt/sagetv/server/Sage.properties
sudo echo 'epg/epg_import_plugin=xmltv.XMLTVImportPlugin' >> /opt/sagetv/server/Sage.properties
# Start Sage Server
sudo -E "PATH=$PATH" -u sagetv /usr/local/bin/startsage &

#########Commnds for UnRaid Docker Compile of Plugin
cd /opt/sagetv/server/xmltv
sh ondocker_build.sh

Code:
 
/* Change Log
##V2.0  01/13/2022
1.  Add code if display-name or channel id number(example 5, 5.1 5-1) then add as the channel number for import.  Examples below import as channel 2.1 and 1162 respectively below
##2.02  01/14/2022
1.  Fixed first channel * bug
2.  Fixed double year in title when title already had a date
3.  add tms filed for episode-num instead of creating unique id
4.  Do not generate SxEx if default case is found ("onscreen", "common")
5.  Fix Display for SxEx in descriptions
6.  Fix short name being set as channel number
7.  Start code for reading Logo Icon for channel (WIP) 
##2.03  01/14/2022
1.  Fixed new Integer((int) to remove compile deprecated warning
2.  Switched org.xml.sax.helpers.XMLReaderFactory to javax.xml.parsers.SAXParserFactory; to remove compile deprecated warning
##2.04 01/16/2022
1.  Added .properties entry for xmltv.channel.display-name.ShortNameIndex 
		 default=0 with no entry .properties file
		 init.ChannelShortNameIndex0:=shortest found without spaces
		 init.ChannelShortNameIndex>0: XMLTV file index found in order starting with 1 <display-name>CBS</display-name>
2.  Added .properties entry for "xmltv.channel.xmltv.channel.ShortNameRegEx"		
		default=.* with no entry .properties file will find anything
3.  Added .properties entry for xmltv.channel.display-name.LongNameIndex 
		default=0 with no entry .properties file
		init.ChannelLongNameIndex0:=longest found with spaces
		init.ChannelLongNameIndex>0: XMLTV file index found in order starting with 1 <display-name>CBS</display-name>
4.  Added .properties entry for xmltv.channel.NumberTag 
		 default="" No entry .properties file.  
		 init.ChannelNumberTag="" None will try to detect channel number from <channel id=XXX> or <display-name>XXX<display-name>
		 init.ChannelNumberTag=channel then <channel id=XXX> 
		 init.ChannelNumberTag=TAG_NAME then <TAG_NAME>xxx<TAG_NAME>
5.  Added .properties entry for init.ChannelNumberTagIndex		
		default=0 with no entry .properties file
		init.ChannelNumberTagIndex=0 None will try to detect channel number from <channel id=xxx> or <display-name>
		init.ChannelNumberTagIndex>0 XMLTV file index found in order starting with 1
6.  Added .properties entry for "xmltv.channel.xmltv.channel.NumberTagRegEx"		
		default=.* with no entry .properties file will find anything
7.  Added .properties entry for "xmltv.channel.IconDownload"
		 default=false with no entry .properties
		 false=Do Note download image file
		 true=Download image file from channel <icon src= >
##2.06 01/18/2022
1.  Added the following .properties entry  for enabling or disabling logging parts.  Defualt with no entry is true
		log.show=false
		log.channel=false
		log.configuration=false
		log.defaults=false
2.	Changed the way ChannelId is calulated. The previous way caused collections.  The new way uses the ProviderID as part of the encoding. The new limit limits the Provider ID to 998. 
		 2147483647	Max Number
		 1000000000
		 1030002100
		      99999	SD MAX it Sends
		  998           Upper Part is Listing ProviderID 1-998 999 used if none provided (* 1000000)
		     123456     Max XMLTV Number without Decimal 999999   
		 1   123456     Max XMLTV Number with Decimal 9999.99 When Decimal (* 100 +1000000000)  
3.  Remove non file characters so Channel icons could be downloaded the following examples where failing: "Cats 24/7" or "Dogs 24/7"	
##2.08 01/28/2022
1.  Filter if desc tag is from channel section.  This would crash the plugin if not done.
2.  Add show if it is up to 8 hours previous. Fixes on first import no data problem
3.  Add setting this.show.showId on <episode-num system="pluto"> tag
4.  Fixed freeFormEpisodeNumber on <episode-num system="onscreen"> and <episode-num system="common"> tags
5.  Add new classs to hold all the init. variables from .properties file
6.  Added xmltv.channel.NumberOffset to offset channel numbers on import.
7.  Added if *.xmltv.properties is found in server directory use it as properties without requirement of configurations= in xmltv.properties file
*/

Attached Images
File Type: png XMLTV_prop_EXAMPLE3.png (441.7 KB, 209 views)
Attached Files
File Type: zip XMLTVImportPlugin_2.08.zip (481.9 KB, 31 views)

Last edited by hvymetal; 01-28-2022 at 08:45 AM.
Reply With Quote
  #2  
Old 01-13-2022, 06:26 PM
boukmandutty boukmandutty is offline
Sage Advanced User
 
Join Date: Oct 2011
Location: Norman OK
Posts: 182
The auto mapping works great.

The problem that remains for me is how sagetv reads the epg provided by Channels dvr. As @nyplayer pointed out over in the hardware thread, sagetv does some strange things with the names of movies and the titles of series when the epg comes form channels dvr. See the attached pictures. The same thing happens when I send the epg from channels dvr through xteve.
Attached Images
File Type: png Screenshot from 2022-01-13 18-17-41.png (57.7 KB, 29 views)
File Type: png Screenshot from 2022-01-13 18-18-01.png (158.6 KB, 22 views)
Reply With Quote
  #3  
Old 01-13-2022, 06:36 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 143
Quote:
Originally Posted by boukmandutty View Post
The auto mapping works great.

The problem that remains for me is how sagetv reads the epg provided by Channels dvr. As @nyplayer pointed out over in the hardware thread, sagetv does some strange things with the names of movies and the titles of series when the epg comes form channels dvr. See the attached pictures. The same thing happens when I send the epg from channels dvr through xteve.
Have you inspect the XMLTV file if is store like that? Also do you sample XMLTV file?
Reply With Quote
  #4  
Old 01-13-2022, 06:52 PM
boukmandutty boukmandutty is offline
Sage Advanced User
 
Join Date: Oct 2011
Location: Norman OK
Posts: 182
I have attached a sample. I dont know where to access the Schedules Direct version for comparison though. I can confirm from experimentation that the current format from the channels dvr server works flawlessly with nextpvr and even with mythtv.
Attached Files
File Type: zip guide.zip (122.6 KB, 19 views)
Reply With Quote
  #5  
Old 01-13-2022, 07:34 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 143
Quote:
Originally Posted by boukmandutty View Post
I have attached a sample. I dont know where to access the Schedules Direct version for comparison though. I can confirm from experimentation that the current format from the channels dvr server works flawlessly with nextpvr and even with mythtv.
Since I do not know which entries are not correct can you provide and example file and test case is wrong? Also it would help if in the photos you highlight the problem.

Thanks
Reply With Quote
  #6  
Old 01-13-2022, 07:08 PM
nyplayer nyplayer is online now
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,798
Quote:
Originally Posted by boukmandutty View Post
The auto mapping works great.

The problem that remains for me is how sagetv reads the epg provided by Channels dvr. As @nyplayer pointed out over in the hardware thread, sagetv does some strange things with the names of movies and the titles of series when the epg comes form channels dvr. See the attached pictures. The same thing happens when I send the epg from channels dvr through xteve.
You got it working on linux ?
__________________
Windows 10 I3 Dual Core 3.0 Server, SageTV9... OpenDCT with 2 HDHRPrimes and 4 HDHRconnects for a total of 14 Tuners.
Reply With Quote
  #7  
Old 01-13-2022, 07:14 PM
boukmandutty boukmandutty is offline
Sage Advanced User
 
Join Date: Oct 2011
Location: Norman OK
Posts: 182
Quote:
Originally Posted by nyplayer View Post
You got it working on linux ?
Yeah the auto-mapping works with the files provided in the attachment above. The only problem continues to be the funky thing that happens with the names.
Reply With Quote
  #8  
Old 01-13-2022, 07:18 PM
nyplayer nyplayer is online now
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,798
Quote:
Originally Posted by boukmandutty View Post
Yeah the auto-mapping works with the files provided in the attachment above. The only problem continues to be the funky thing that happens with the names.
I guess I will wait ...
Yeah the names and epgid etc ...also season and episode even though it is there is not recognized by SageTV. So I went with a sched direct west coast and east coast lineup.... and manually mapped channels I wanted.
__________________
Windows 10 I3 Dual Core 3.0 Server, SageTV9... OpenDCT with 2 HDHRPrimes and 4 HDHRconnects for a total of 14 Tuners.
Reply With Quote
  #9  
Old 01-13-2022, 07:39 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 143
Quote:
Originally Posted by nyplayer View Post
You got it working on linux ?
The plug in not Linux dependent it should also work with windows.
Reply With Quote
  #10  
Old 01-13-2022, 07:46 PM
nyplayer nyplayer is online now
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,798
Quote:
Originally Posted by hvymetal View Post
The plug in not Linux dependent it should also work with windows.
Great I will test it on my Windows test machine ...


I know for sure there is no original airdate parsed season episode parsed as misc.... and epgid data is wrong ...

https://forums.sagetv.com/forums/showthread.php?t=66885
__________________
Windows 10 I3 Dual Core 3.0 Server, SageTV9... OpenDCT with 2 HDHRPrimes and 4 HDHRconnects for a total of 14 Tuners.
Reply With Quote
  #11  
Old 01-13-2022, 09:21 PM
boukmandutty boukmandutty is offline
Sage Advanced User
 
Join Date: Oct 2011
Location: Norman OK
Posts: 182
The pictures are below.

The xmltv info for The Angry Birds is:

Quote:
<programme start="20220114020000 +0000" stop="20220114040000 +0000" channel="6081">
<title>The Angry Birds Movie 2 (2019)</title>
<desc>The birds unite with the green pigs when fowl from an ice-covered island plan to destroy them both.</desc>
<category>Movie</category>
<category>Feature Film</category>
<category>Animated</category>
<category>Children</category>
<category>Comedy</category>
<category>Adventure</category>
<icon src="https://tmsimg.fancybits.co/assets/p14568986_v_v12_ac.jpg?w=480&amp;h=720"></icon>
<date>20190802</date>
<previously-shown></previously-shown>
<episode-num system="tms">MV010390220000</episode-num>
<credits>
<director>Thurop Van Orman</director>
<actor>Jason Sudeikis</actor>
<actor>Josh Gad</actor>
<actor>Leslie Jones</actor>
</credits>
</programme>
The Family Guy episode:
Quote:
<programme start="20220114023000 +0000" stop="20220114030000 +0000" channel="6082">
<title>Family Guy</title>
<sub-title>Peter's Progress</sub-title>
<desc>A psychic reveals that Peter had a past life in the 17th century as Griffin Peterson.</desc>
<category>Episode</category>
<category>Series</category>
<category>Animated</category>
<category>Sitcom</category>
<icon src="http://tmsimg.fancybits.co/assets/p184483_b_h6_bb.jpg"></icon>
<series-id system="tms">184483</series-id>
<date>20090517</date>
<previously-shown></previously-shown>
<episode-num system="tms">EP002960010132</episode-num>
<episode-num system="onscreen">S7E16</episode-num>
<episode-num system="xmltv_ns">6.15.</episode-num>
<credits>
<director>Brian Iles</director>
<director>Peter Shin</director>
<actor>Seth MacFarlane</actor>
<actor>Alex Borstein</actor>
<actor>Seth Green</actor>
</credits>
</programme>
I have attached for each a marked-up picture of what it looks like with the xmltv plugin. There is also a picture of what it looks like when Schedules Direct is used through the tedious mapping.

@nyplayer I didn't see your recent posts on your attempt to fix this until just now when you linked to it. If you have managed to fix any part of what I have here let me know.
Reply With Quote
  #12  
Old 01-14-2022, 03:24 AM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 143
Quote:
Originally Posted by nyplayer View Post
Not sure if I fixed the problem because I could not find it but some of the other changes might have solved this one also.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updated XMLTV How To rsagetv99 SageTV EPG Service 37 07-25-2012 12:00 PM
Plugin Verifier Has Been Updated Narflex SageTV v7 Customizations 5 06-14-2010 03:32 PM
XMLTV data not being updated... dooferlad SageTV United Kingdom 22 01-03-2008 04:52 AM
Updated XMLTV import plugin (mostly for dutch users) koelie SageTV EPG Service 14 05-01-2005 11:46 PM
How do I compile xmltv plugin? owilsky SageTV EPG Service 3 01-20-2005 12:12 PM


All times are GMT -6. The time now is 11:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.