From bf9a43b3d14be89366a414c2299956ed6c67e683 Mon Sep 17 00:00:00 2001 From: Ruud Date: Mon, 10 Mar 2014 14:10:29 +0100 Subject: [PATCH] Make sure name is string type, not bs4 class --- couchpotato/core/providers/torrent/iptorrents/main.py | 2 +- couchpotato/core/providers/torrent/publichd/main.py | 2 +- couchpotato/core/providers/torrent/thepiratebay/main.py | 2 +- couchpotato/core/providers/torrent/torrentleech/main.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/couchpotato/core/providers/torrent/iptorrents/main.py b/couchpotato/core/providers/torrent/iptorrents/main.py index 5c22ae04..7ff3cb91 100644 --- a/couchpotato/core/providers/torrent/iptorrents/main.py +++ b/couchpotato/core/providers/torrent/iptorrents/main.py @@ -72,7 +72,7 @@ class IPTorrents(TorrentProvider): torrent = cells[1].find('a') torrent_id = torrent['href'].replace('/details.php?id=', '') - torrent_name = torrent.string + torrent_name = unicode(torrent.string) torrent_download_url = self.urls['base_url'] + (result.find_all('td')[3].find('a'))['href'].replace(' ', '.') torrent_details_url = self.urls['base_url'] + torrent['href'] torrent_size = self.parseSize(result.find_all('td')[5].string) diff --git a/couchpotato/core/providers/torrent/publichd/main.py b/couchpotato/core/providers/torrent/publichd/main.py index b200b1fd..8749b582 100644 --- a/couchpotato/core/providers/torrent/publichd/main.py +++ b/couchpotato/core/providers/torrent/publichd/main.py @@ -54,7 +54,7 @@ class PublicHD(TorrentMagnetProvider): results.append({ 'id': url['id'][0], - 'name': info_url.string, + 'name': unicode(info_url.string), 'url': download['href'], 'detail_url': self.urls['detail'] % url['id'][0], 'size': self.parseSize(result.find_all('td')[7].string), diff --git a/couchpotato/core/providers/torrent/thepiratebay/main.py b/couchpotato/core/providers/torrent/thepiratebay/main.py index 61f12ad1..3bf53f75 100644 --- a/couchpotato/core/providers/torrent/thepiratebay/main.py +++ b/couchpotato/core/providers/torrent/thepiratebay/main.py @@ -88,7 +88,7 @@ class ThePirateBay(TorrentMagnetProvider): results.append({ 'id': re.search('/(?P\d+)/', link['href']).group('id'), - 'name': link.string, + 'name': unicode(link.string), 'url': download['href'], 'detail_url': self.getDomain(link['href']), 'size': self.parseSize(size), diff --git a/couchpotato/core/providers/torrent/torrentleech/main.py b/couchpotato/core/providers/torrent/torrentleech/main.py index 80c426f8..cb7cc043 100644 --- a/couchpotato/core/providers/torrent/torrentleech/main.py +++ b/couchpotato/core/providers/torrent/torrentleech/main.py @@ -56,7 +56,7 @@ class TorrentLeech(TorrentProvider): results.append({ 'id': link['href'].replace('/torrent/', ''), - 'name': link.string, + 'name': unicode(link.string), 'url': self.urls['download'] % url['href'], 'detail_url': self.urls['download'] % details['href'], 'size': self.parseSize(result.find_all('td')[4].string),