diff --git a/modules/kickass/backend.py b/modules/kickass/backend.py index d398e848..cfe94a2b 100644 --- a/modules/kickass/backend.py +++ b/modules/kickass/backend.py @@ -63,7 +63,6 @@ class KickassBackend(BaseBackend, ICapTorrent): return self.browser.iter_torrents(quote_plus(pattern.encode('utf-8'))) def fill_torrent(self, torrent, fields): - print "plpl" if 'description' in fields or fields == None: return self.get_torrent(torrent.id) diff --git a/modules/kickass/pages.py b/modules/kickass/pages.py index 4aacb1c5..19677344 100644 --- a/modules/kickass/pages.py +++ b/modules/kickass/pages.py @@ -26,7 +26,7 @@ except ImportError: from urlparse import urlsplit from weboob.capabilities.torrent import Torrent -from weboob.capabilities.base import NotAvailable +from weboob.capabilities.base import NotAvailable, NotLoaded from weboob.tools.browser import BasePage from weboob.tools.misc import get_bytes_size @@ -70,7 +70,8 @@ class TorrentsPage(BasePage): torrent = Torrent(idt, title) torrent.url = url torrent.magnet = magnet - torrent.description = NotAvailable.__unicode__() + torrent.description = NotLoaded + torrent.files = NotLoaded torrent.filename = parse_qs(urlsplit(url).query).get('title', [None])[0] torrent.size = get_bytes_size(size, u) torrent.seeders = int(seed) @@ -82,7 +83,7 @@ class TorrentPage(BasePage): def get_torrent(self, id): seed = 0 leech = 0 - description = NotAvailable.__unicode__() + description = NotAvailable url = NotAvailable magnet = NotAvailable title = NotAvailable @@ -142,6 +143,8 @@ class TorrentPage(BasePage): torrent.size = get_bytes_size(size, u) torrent.seeders = int(seed) torrent.leechers = int(leech) + if description == '': + description = NotAvailable torrent.description = description torrent.files = files return torrent diff --git a/weboob/applications/weboorrents/weboorrents.py b/weboob/applications/weboorrents/weboorrents.py index 0feb211b..5f3299a9 100644 --- a/weboob/applications/weboorrents/weboorrents.py +++ b/weboob/applications/weboorrents/weboorrents.py @@ -54,7 +54,7 @@ class TorrentInfoFormatter(IFormatter): for f in obj.files: result += ' * %s\n' % f result += '\n%sDescription%s\n' % (self.BOLD, self.NC) - result += obj.description + result += '%s'%obj.description return result @@ -95,14 +95,7 @@ class Weboorrents(ReplApplication): Get information about a torrent. """ - # Following commented line could be better - #torrent = self.get_object(id, 'get_torrent', ('description','files')) - torrent = None - _id, backend = self.parse_id(id) - for _backend, result in self.do('get_torrent', _id, backends=backend, caps=ICapTorrent): - if result: - backend = _backend - torrent = result + torrent = self.get_object(id, 'get_torrent', ('description','files')) if not torrent: print >>sys.stderr, 'Torrent not found: %s' % id return 3