- Reverse the default for BaseProcessor.valid. Set valid=True when valid data is obtained from one URL, even if other URLs fail.
- Remove JSW flag - now works by whether it finds the matching json data.
- Make PlusOnes use json configuration.
+0.6.1 JSW
+ - Make failure to access version update data a warning instead of a failure. This was causing xmltv-proc-nz to fail as epg.org.nz
+ is no longer working (although the site still exists).
+ - Remove epg.org.nz as it is no longer working.
"""
#TODO: Find repeats
#TODO: Regex replacements for categories
tvdb = tvdb_api.Tvdb(language='en')
NAME = 'xmltv-proc-nz'
-URL = 'http://nice.net.nz/xmltv-proc-nz'
-VERSION = '0.6.0 JSW'
-BASE_URL = 'http://epg.org.nz'
-JSON_BASE_URLS = ['http://epg.org.nz', 'http://localhost/json', 'file:///etc/mythtv-epg-nz/xmltv-proc-nz/json']
+#URL = 'http://nice.net.nz/xmltv-proc-nz'
+URL = 'http://www.jsw.gen.nz/mythtv/xmltv-proc-nz'
+VERSION = '0.6.1 JSW'
+#BASE_URL = 'http://epg.org.nz'
+BASE_URL = ''
+#JSON_BASE_URLS = ['http://epg.org.nz', 'http://localhost/json']
+JSON_BASE_URLS = ['http://localhost/json', 'file:///etc/mythtv-epg-nz/xmltv-proc-nz/json']
TIME_FORMAT = '%Y%m%d%H%M%S'
LOG_LEVEL = logging.INFO
#LOG_LEVEL = logging.WARNING
"""
Check for script updates.
"""
- try:
- data = urlopen('%s/xmltv-proc-nz/+json' % BASE_URL).read()
- except IOError:
- log.critical('Cannot access Internet')
- sys.exit(3)
- else:
+ if BASE_URL != '':
try:
- stats = json.loads(data)
- except ValueError as e:
- print(e)
- log.critical('Version check failed')
- sys.exit(4)
- if stats['version'] > VERSION:
- log.warning(
- 'A new version (%s) is available at %s (current version %s)',
- stats['version'],
- URL,
- VERSION
- )
- if stats['critical']:
- log.critical('Version update is critical, exiting')
- sys.exit(5)
+ url = '%s/xmltv-proc-nz/+json' % BASE_URL
+ data = urlopen(url).read()
+ except IOError:
+ log.warning(f'Update check failed, cannot access {url}')
+ else:
+ try:
+ stats = json.loads(data)
+ except ValueError as e:
+ print(e)
+ log.critical('Version check failed')
+ sys.exit(4)
+ if stats['version'] > VERSION:
+ log.warning(
+ 'A new version (%s) is available at %s (current version %s)',
+ stats['version'],
+ URL,
+ VERSION
+ )
+ if stats['critical']:
+ log.critical('Version update is critical, exiting')
+ sys.exit(5)
if __name__ == '__main__':
parser = OptionParser(version='%prog ' + str(VERSION))