diff --git a/sickbeard/providers/iptorrents.py b/sickbeard/providers/iptorrents.py index 19bd80bb..09f4a45c 100644 --- a/sickbeard/providers/iptorrents.py +++ b/sickbeard/providers/iptorrents.py @@ -162,9 +162,11 @@ class IPTorrentsProvider(generic.TorrentProvider): for mode in search_params.keys(): for search_string in search_params[mode]: + if isinstance(search_string, unicode): + search_string = unidecode(search_string) # URL with 50 tv-show results, or max 150 if adjusted in IPTorrents profile - searchURL = self.urls['search'] % (self.categorie, freeleech, unidecode(search_string)) + searchURL = self.urls['search'] % (self.categorie, freeleech, search_string) searchURL += ';o=seeders' if mode != 'RSS' else '' logger.log(u"" + self.name + " search page URL: " + searchURL, logger.DEBUG) diff --git a/sickbeard/providers/kat.py b/sickbeard/providers/kat.py index e0903d82..40202a7b 100644 --- a/sickbeard/providers/kat.py +++ b/sickbeard/providers/kat.py @@ -225,10 +225,12 @@ class KATProvider(generic.TorrentProvider): for mode in search_params.keys(): for search_string in search_params[mode]: + if isinstance(search_string, unicode): + search_string = unidecode(search_string) entries = [] for url in self.urls: - searchURL = url + 'usearch/%s/?field=seeders&sorder=desc&rss=1' % urllib.urlencode(search_string.encode('utf-8')) + searchURL = url + 'usearch/%s/?field=seeders&sorder=desc&rss=1' % urllib.quote(search_string) logger.log(u"Search string: " + searchURL, logger.DEBUG) entries = self.cache.getRSSFeed(url, items=['entries', 'feed'])['entries'] diff --git a/sickbeard/providers/thepiratebay.py b/sickbeard/providers/thepiratebay.py index 0448b7a8..8e3c3ab7 100644 --- a/sickbeard/providers/thepiratebay.py +++ b/sickbeard/providers/thepiratebay.py @@ -230,9 +230,11 @@ class ThePirateBayProvider(generic.TorrentProvider): for mode in search_params.keys(): for search_string in search_params[mode]: + if isinstance(search_string, unicode): + search_string = unidecode(search_string) if mode != 'RSS': - searchURL = self.proxy._buildURL(self.searchurl % (urllib.quote(unidecode(search_string)))) + searchURL = self.proxy._buildURL(self.searchurl % (urllib.quote(search_string))) else: searchURL = self.proxy._buildURL(self.url + 'tv/latest/') diff --git a/sickbeard/versionChecker.py b/sickbeard/versionChecker.py index 2a4bcbf2..c1506f01 100644 --- a/sickbeard/versionChecker.py +++ b/sickbeard/versionChecker.py @@ -557,6 +557,23 @@ class GitUpdateManager(UpdateManager): if sickbeard.NOTIFY_ON_UPDATE: notifiers.notify_git_update(sickbeard.CUR_COMMIT_HASH if sickbeard.CUR_COMMIT_HASH else "") return True + else: + # perform a hard reset to try and resolve the issue + if self.reset() and self.update(): + return True + + return False + + def reset(self): + """ + Calls git reset --hard to perform a hard reset. Returns a bool depending + on the call's success. + """ + + output, err, exit_status = self._run_git(self._git_path, 'reset --hard') # @UnusedVariable + + if exit_status == 0: + return True return False