Fix archive search and correct logging for foreign searches

Archive searches are now handled correctly
Fix debug logging for searches in foreign section
Include title fix from mr-oranges's PirateBay edition
This commit is contained in:
iron8core 2014-04-28 13:26:25 +02:00
parent 99bbd0649c
commit 0f395a636a

View file

@ -158,7 +158,7 @@ class SCCProvider(generic.TorrentProvider):
if mode == 'Season':
searchURL = self.urls['archive'] % (search_string)
data = self.getURL(searchURL, headers=self.headers)
data = [self.getURL(searchURL, headers=self.headers)]
else:
searchURL = self.urls['search'] % (search_string, self.categories)
nonsceneSearchURL = self.urls['nonscene'] % (search_string)
@ -196,6 +196,9 @@ class SCCProvider(generic.TorrentProvider):
link = result.find('td', attrs={'class': 'ttr_name'}).find('a')
url = result.find('td', attrs={'class': 'td_dl'}).find('a')
title = link.string
if re.search('\.\.\.', title):
details_html = BeautifulSoup(self.getURL(self.url + "/" + link['href']))
title = re.search('(?<=").+(?<!")', details_html.title.string).group(0)
download_url = self.urls['download'] % url['href']
id = int(link['href'].replace('details?id=', ''))
seeders = int(result.find('td', attrs={'class': 'ttr_seeders'}).string)
@ -213,7 +216,7 @@ class SCCProvider(generic.TorrentProvider):
if re.search('<title>SceneAccess \| Non-Scene</title>', dataItem):
logger.log(u"Found result: " + title + "(" + nonsceneSearchURL + ")", logger.DEBUG)
elif re.search('<title>SceneAccess \| Non-Scene</title>', dataItem):
elif re.search('<title>SceneAccess \| Foreign</title>', dataItem):
logger.log(u"Found result: " + title + "(" + foreignSearchURL + ")", logger.DEBUG)
else:
logger.log(u"Found result: " + title + "(" + searchURL + ")", logger.DEBUG)