diff --git a/sickbeard/scene_exceptions.py b/sickbeard/scene_exceptions.py index 24e29690..e3257d47 100644 --- a/sickbeard/scene_exceptions.py +++ b/sickbeard/scene_exceptions.py @@ -66,56 +66,62 @@ def retrieve_exceptions(): """ exception_dict = {} + url_data = '' # exceptions are stored on github pages - url = 'http://midgetspy.github.com/sb_tvdb_scene_exceptions/exceptions.txt' + url_dict = { + 'TheTVDB': 'http://midgetspy.github.com/sb_tvdb_scene_exceptions/exceptions.txt', + 'TVRage': 'http://raw.github.com/echel0n/sb_tvrage_scene_exceptions/master/exceptions.txt' + } - logger.log(u"Check scene exceptions update") - url_data = helpers.getURL(url) + for indexer, url in url_dict.iteritems(): + logger.log(u"Checking for scene exception updates for " + indexer) - if url_data is None: - # When urlData is None, trouble connecting to github - logger.log(u"Check scene exceptions update failed. Unable to get URL: " + url, logger.ERROR) - return + url_data = helpers.getURL(url) - else: - # each exception is on one line with the format indexer_id: 'show name 1', 'show name 2', etc - for cur_line in url_data.splitlines(): - cur_line = cur_line.decode('utf-8') - indexer_id, sep, aliases = cur_line.partition(':') #@UnusedVariable + if url_data is None: + # When urlData is None, trouble connecting to github + logger.log(u"Check scene exceptions update failed. Unable to get URL: " + url, logger.ERROR) + continue - if not aliases: - continue - - indexer_id = int(indexer_id) - - # regex out the list of shows, taking \' into account - alias_list = [re.sub(r'\\(.)', r'\1', x) for x in re.findall(r"'(.*?)(?