Merge branch 'refs/heads/saxicek-tsh_scene_only' into develop
This commit is contained in:
@@ -15,7 +15,7 @@ class TorrentShack(TorrentProvider):
|
|||||||
'login' : 'https://torrentshack.net/login.php',
|
'login' : 'https://torrentshack.net/login.php',
|
||||||
'login_check': 'https://torrentshack.net/inbox.php',
|
'login_check': 'https://torrentshack.net/inbox.php',
|
||||||
'detail' : 'https://torrentshack.net/torrent/%s',
|
'detail' : 'https://torrentshack.net/torrent/%s',
|
||||||
'search' : 'https://torrentshack.net/torrents.php?searchstr=%s&filter_cat[%d]=1',
|
'search' : 'https://torrentshack.net/torrents.php?action=advanced&searchstr=%s&scene=%s&filter_cat[%d]=1',
|
||||||
'download' : 'https://torrentshack.net/%s',
|
'download' : 'https://torrentshack.net/%s',
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +31,9 @@ class TorrentShack(TorrentProvider):
|
|||||||
|
|
||||||
def _searchOnTitle(self, title, movie, quality, results):
|
def _searchOnTitle(self, title, movie, quality, results):
|
||||||
|
|
||||||
url = self.urls['search'] % (tryUrlencode('"%s" %s' % (title.replace(':', ''), movie['library']['year'])), self.getCatId(quality['identifier'])[0])
|
scene_only = '1' if self.conf('scene_only') else ''
|
||||||
|
|
||||||
|
url = self.urls['search'] % (tryUrlencode('%s %s' % (title.replace(':', ''), movie['library']['year'])), scene_only, self.getCatId(quality['identifier'])[0])
|
||||||
data = self.getHTMLData(url, opener = self.login_opener)
|
data = self.getHTMLData(url, opener = self.login_opener)
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
@@ -49,22 +51,15 @@ class TorrentShack(TorrentProvider):
|
|||||||
link = result.find('span', attrs = {'class' : 'torrent_name_link'}).parent
|
link = result.find('span', attrs = {'class' : 'torrent_name_link'}).parent
|
||||||
url = result.find('td', attrs = {'class' : 'torrent_td'}).find('a')
|
url = result.find('td', attrs = {'class' : 'torrent_td'}).find('a')
|
||||||
|
|
||||||
extra_info = ''
|
results.append({
|
||||||
if result.find('span', attrs = {'class' : 'torrent_extra_info'}):
|
'id': link['href'].replace('torrents.php?torrentid=', ''),
|
||||||
extra_info = result.find('span', attrs = {'class' : 'torrent_extra_info'}).text
|
'name': unicode(link.span.string).translate({ord(u'\xad'): None}),
|
||||||
|
'url': self.urls['download'] % url['href'],
|
||||||
if not self.conf('scene_only') or extra_info != '[NotScene]':
|
'detail_url': self.urls['download'] % link['href'],
|
||||||
results.append({
|
'size': self.parseSize(result.find_all('td')[4].string),
|
||||||
'id': link['href'].replace('torrents.php?torrentid=', ''),
|
'seeders': tryInt(result.find_all('td')[6].string),
|
||||||
'name': unicode(link.span.string).translate({ord(u'\xad'): None}),
|
'leechers': tryInt(result.find_all('td')[7].string),
|
||||||
'url': self.urls['download'] % url['href'],
|
})
|
||||||
'detail_url': self.urls['download'] % link['href'],
|
|
||||||
'size': self.parseSize(result.find_all('td')[4].string),
|
|
||||||
'seeders': tryInt(result.find_all('td')[6].string),
|
|
||||||
'leechers': tryInt(result.find_all('td')[7].string),
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
log.info('Not adding release %s [NotScene]' % unicode(link.span.string).translate({ord(u'\xad'): None}))
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
log.error('Failed to parsing %s: %s', (self.getName(), traceback.format_exc()))
|
log.error('Failed to parsing %s: %s', (self.getName(), traceback.format_exc()))
|
||||||
|
|||||||
Reference in New Issue
Block a user