Fix for newznab provider searches unicode issues

This commit is contained in:
echel0n 2014-08-23 14:39:10 -07:00
parent 5a027fdbe0
commit 4b6602797f
2 changed files with 11 additions and 8 deletions

View file

@ -221,16 +221,22 @@ class GenericProvider:
Returns: A tuple containing two strings representing title and URL respectively
"""
title = item.title if item.title else None
title = None
url = None
if 'title' in item:
title = item.title
if title:
title = u'' + title
title = title.replace(' ', '.')
url = item.link if item.link else None
if 'link' in item:
url = item.link
if url:
url = url.replace('&', '&')
return (title, url)
return title, url
def findSearchResults(self, show, season, episodes, search_mode, manualSearch=False):

View file

@ -206,7 +206,6 @@ class NewznabProvider(generic.NZBProvider):
params['apikey'] = self.key
results = []
keep_searching = 1
while True:
search_url = self.url + 'api?' + urllib.urlencode(params)
@ -219,7 +218,7 @@ class NewznabProvider(generic.NZBProvider):
(title, url) = self._get_title_and_url(item)
if title and url:
results.append(item)
results.append(title,url)
else:
logger.log(
u"The data returned from the " + self.name + " is incomplete, this result is unusable",
@ -247,8 +246,6 @@ class NewznabProvider(generic.NZBProvider):
return results
def findPropers(self, search_date=None):
search_terms = ['.proper.', '.repack.']