Torrentshack cleanup
This commit is contained in:
@@ -12,7 +12,6 @@ config = [{
|
|||||||
'list': 'torrent_providers',
|
'list': 'torrent_providers',
|
||||||
'name': 'TorrentShack',
|
'name': 'TorrentShack',
|
||||||
'description': 'See <a href="http://www.torrentshack.net/">TorrentShack</a>',
|
'description': 'See <a href="http://www.torrentshack.net/">TorrentShack</a>',
|
||||||
'wizard': True,
|
|
||||||
'options': [
|
'options': [
|
||||||
{
|
{
|
||||||
'name': 'enabled',
|
'name': 'enabled',
|
||||||
@@ -29,9 +28,10 @@ config = [{
|
|||||||
'type': 'password',
|
'type': 'password',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'scene only',
|
'name': 'scene_only',
|
||||||
'type': 'bool',
|
'type': 'bool',
|
||||||
'default': False
|
'default': False,
|
||||||
|
'description': 'Only allow scene releases.'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'extra_score',
|
'name': 'extra_score',
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ from couchpotato.core.logger import CPLog
|
|||||||
from couchpotato.core.providers.torrent.base import TorrentProvider
|
from couchpotato.core.providers.torrent.base import TorrentProvider
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
log = CPLog(__name__)
|
log = CPLog(__name__)
|
||||||
|
|
||||||
|
|
||||||
@@ -31,7 +30,7 @@ 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])
|
url = self.urls['search'] % (tryUrlencode('"%s" %s' % (title.replace(':', ''), movie['library']['year'])), 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:
|
||||||
@@ -53,7 +52,7 @@ class TorrentShack(TorrentProvider):
|
|||||||
if result.find('span', attrs = {'class' : 'torrent_extra_info'}):
|
if result.find('span', attrs = {'class' : 'torrent_extra_info'}):
|
||||||
extra_info = result.find('span', attrs = {'class' : 'torrent_extra_info'}).text
|
extra_info = result.find('span', attrs = {'class' : 'torrent_extra_info'}).text
|
||||||
|
|
||||||
if not self.conf('scene only') or extra_info != '[NotScene]':
|
if not self.conf('scene_only') or extra_info != '[NotScene]':
|
||||||
results.append({
|
results.append({
|
||||||
'id': link['href'].replace('torrents.php?torrentid=', ''),
|
'id': link['href'].replace('torrents.php?torrentid=', ''),
|
||||||
'name': unicode(link.span.string).translate({ord(u'\xad'): None}),
|
'name': unicode(link.span.string).translate({ord(u'\xad'): None}),
|
||||||
@@ -64,7 +63,6 @@ class TorrentShack(TorrentProvider):
|
|||||||
'seeders': tryInt(result.find_all('td')[6].string),
|
'seeders': tryInt(result.find_all('td')[6].string),
|
||||||
'leechers': tryInt(result.find_all('td')[7].string),
|
'leechers': tryInt(result.find_all('td')[7].string),
|
||||||
})
|
})
|
||||||
log.info('Adding release %s' % unicode(link.span.string).translate({ord(u'\xad'): None}))
|
|
||||||
else:
|
else:
|
||||||
log.info('Not adding release %s [NotScene]' % unicode(link.span.string).translate({ord(u'\xad'): None}))
|
log.info('Not adding release %s [NotScene]' % unicode(link.span.string).translate({ord(u'\xad'): None}))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user