From: Andrew Ruthven Date: Sun, 1 Jan 2023 06:27:26 +0000 (+1300) Subject: Import 0.6.3 of xmltv-proc-nz X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;p=mythtv-epg-nz.git Import 0.6.3 of xmltv-proc-nz --- diff --git a/bin/xmltv-proc-nz b/bin/xmltv-proc-nz index c218782..ed6865c 100644 --- a/bin/xmltv-proc-nz +++ b/bin/xmltv-proc-nz @@ -51,6 +51,10 @@ JSW = Stephen Worthington 0.6.2 JSW - Add a file:/// URL to JSON_BASE_URLS to support the use of /etc/mythtv-epg-nz for configuring xmltv-proc-nz, as required for Andrew Ruthven's .deb install. +0.6.3 JSW + - Fix Sky Movies procssing, so that it works. + - Sky Movies: Move PREMIERE to description. + - Sky Movies: Join up split titles where part of the title is in the subtitle. """ #TODO: Find repeats #TODO: Regex replacements for categories @@ -752,13 +756,13 @@ class SkyMoviesChannels(BaseProcessor): self.sky_movies_xmltvid_list = None for json_base_url in JSON_BASE_URLS: try: - data = urlopen('%s/sky_movies_xmltvids/+json' % json_base_url).read() + data = urlopen('%s/sky-movies-xmltvids/+json' % json_base_url).read() except IOError: log.warning('SkyMoviesChannels: Fetching data from %s failed.' % json_base_url) else: try: sky_movies_xmltvid_list = json.loads(data) - if self.categories == None: + if self.sky_movies_xmltvid_list == None: self.sky_movies_xmltvid_list = sky_movies_xmltvid_list else: self.sky_movies_xmltvid_list += sky_movies_xmltvid_list @@ -783,7 +787,26 @@ class SkyMoviesChannels(BaseProcessor): ) else: #sys.stderr.write('programme=' + ElementTree.tostring(programme, encoding='utf-8') + '\n') - programme.find('desc').text = programme.find('sub-title').text + ' ' + programme.find('desc').text + title = programme.find('title').text + subtitle = programme.find('sub-title').text + premiere = False + if title != 'Stay tuned...' and title != 'On DUKE today...': + if title[0:9] == 'PREMIERE ': + premiere = True + title = title[9:] + if title[0:10] == 'PREMIERE: ': + premiere = True + title = title[10:] + if title[-3:] == '...': + if subtitle[0:3] == '...': + subtitle = subtitle[3:] + location = subtitle.find('. ') + if location != -1: + title_second_part = subtitle[0:location] + subtitle = subtitle[location+2:] + title = title[0:-3] + ' ' + title_second_part + programme.find('title').text = title + programme.find('desc').text = ('PREMIERE: ' if premiere else '') + subtitle + ' ' + programme.find('desc').text programme.find('sub-title').text = '' log.info( 'SkyMoviesChannels: channel=%s title=%s fixed',