1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Merge branch 'pulls/62'

This commit is contained in:
echel0n 2014-04-25 00:32:22 -07:00
commit dafff0281e

View File

@ -44,6 +44,8 @@ class SCCProvider(generic.TorrentProvider):
'login': 'https://sceneaccess.eu/login',
'detail': 'https://www.sceneaccess.eu/details?id=%s',
'search': 'https://sceneaccess.eu/browse?search=%s&method=1&%s',
'nonscene': 'https://sceneaccess.eu/nonscene?search=%s&method=1&c44=44&c45=44',
'foreign': 'https://sceneaccess.eu/foreign?search=%s&method=1&c34=34&c33=33',
'archive': 'https://sceneaccess.eu/archive?search=%s&method=1&c26=26',
'download': 'https://www.sceneaccess.eu/%s',
}
@ -159,17 +161,25 @@ class SCCProvider(generic.TorrentProvider):
if mode == 'Season':
searchURL = self.urls['archive'] % (search_string)
data = self.getURL(searchURL, headers=self.headers)
else:
searchURL = self.urls['search'] % (search_string, self.categories)
nonsceneSearchURL = self.urls['nonscene'] % (search_string)
foreignSearchURL = self.urls['foreign'] % (search_string)
data = [self.getURL(searchURL, headers=self.headers),
self.getURL(nonsceneSearchURL, headers=self.headers),
self.getURL(foreignSearchURL, headers=self.headers)]
logger.log(u"Search string: " + nonsceneSearchURL, logger.DEBUG)
logger.log(u"Search string: " + foreignSearchURL, logger.DEBUG)
logger.log(u"Search string: " + searchURL, logger.DEBUG)
data = self.getURL(searchURL, headers=self.headers)
if not data:
continue
try:
html = BeautifulSoup(data, features=["html5lib", "permissive"])
for dataItem in data:
html = BeautifulSoup(dataItem, features=["html5lib", "permissive"])
torrent_table = html.find('table', attrs={'id': 'torrents-table'})
torrent_rows = torrent_table.find_all('tr') if torrent_table else []
@ -203,6 +213,12 @@ class SCCProvider(generic.TorrentProvider):
continue
item = title, download_url, id, seeders, leechers
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):
logger.log(u"Found result: " + title + "(" + foreignSearchURL + ")", logger.DEBUG)
else:
logger.log(u"Found result: " + title + "(" + searchURL + ")", logger.DEBUG)
items[mode].append(item)