From 91e0452320c9a210bd0db7948edff1bc9fdf0e3b Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 29 May 2013 19:03:28 +0200 Subject: [PATCH] Torrentshack cleanup --- couchpotato/core/providers/torrent/torrentshack/__init__.py | 6 +++--- couchpotato/core/providers/torrent/torrentshack/main.py | 6 ++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/couchpotato/core/providers/torrent/torrentshack/__init__.py b/couchpotato/core/providers/torrent/torrentshack/__init__.py index 1c0d8a12..203e0996 100644 --- a/couchpotato/core/providers/torrent/torrentshack/__init__.py +++ b/couchpotato/core/providers/torrent/torrentshack/__init__.py @@ -12,7 +12,6 @@ config = [{ 'list': 'torrent_providers', 'name': 'TorrentShack', 'description': 'See TorrentShack', - 'wizard': True, 'options': [ { 'name': 'enabled', @@ -29,9 +28,10 @@ config = [{ 'type': 'password', }, { - 'name': 'scene only', + 'name': 'scene_only', 'type': 'bool', - 'default': False + 'default': False, + 'description': 'Only allow scene releases.' }, { 'name': 'extra_score', diff --git a/couchpotato/core/providers/torrent/torrentshack/main.py b/couchpotato/core/providers/torrent/torrentshack/main.py index 08e0faf6..df2ea291 100644 --- a/couchpotato/core/providers/torrent/torrentshack/main.py +++ b/couchpotato/core/providers/torrent/torrentshack/main.py @@ -5,7 +5,6 @@ from couchpotato.core.logger import CPLog from couchpotato.core.providers.torrent.base import TorrentProvider import traceback - log = CPLog(__name__) @@ -31,7 +30,7 @@ class TorrentShack(TorrentProvider): 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) if data: @@ -53,7 +52,7 @@ class TorrentShack(TorrentProvider): if result.find('span', attrs = {'class' : 'torrent_extra_info'}): 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({ 'id': link['href'].replace('torrents.php?torrentid=', ''), '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), 'leechers': tryInt(result.find_all('td')[7].string), }) - log.info('Adding release %s' % unicode(link.span.string).translate({ord(u'\xad'): None})) else: log.info('Not adding release %s [NotScene]' % unicode(link.span.string).translate({ord(u'\xad'): None}))