Make sure name is string type, not bs4 class

This commit is contained in:
Ruud committed 2014-03-10 14:10:29 +01:00
1 parent bca597c4e2
commit bf9a43b3d1
4 files changed
+4 -4

No files matched your search

@@ -72,7 +72,7 @@ class IPTorrents(TorrentProvider):
torrent = cells[1].find('a') torrent = cells[1].find('a')
torrent_id = torrent['href'].replace('/details.php?id=', '') 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_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_details_url = self.urls['base_url'] + torrent['href']
torrent_size = self.parseSize(result.find_all('td')[5].string) torrent_size = self.parseSize(result.find_all('td')[5].string)
@@ -54,7 +54,7 @@ class PublicHD(TorrentMagnetProvider):
results.append({ results.append({
'id': url['id'][0], 'id': url['id'][0],
'name': info_url.string, 'name': unicode(info_url.string),
'url': download['href'], 'url': download['href'],
'detail_url': self.urls['detail'] % url['id'][0], 'detail_url': self.urls['detail'] % url['id'][0],
'size': self.parseSize(result.find_all('td')[7].string), 'size': self.parseSize(result.find_all('td')[7].string),
@@ -88,7 +88,7 @@ class ThePirateBay(TorrentMagnetProvider):
results.append({ results.append({
'id': re.search('/(?P<id>\d+)/', link['href']).group('id'), 'id': re.search('/(?P<id>\d+)/', link['href']).group('id'),
'name': link.string, 'name': unicode(link.string),
'url': download['href'], 'url': download['href'],
'detail_url': self.getDomain(link['href']), 'detail_url': self.getDomain(link['href']),
'size': self.parseSize(size), 'size': self.parseSize(size),
@@ -56,7 +56,7 @@ class TorrentLeech(TorrentProvider):
results.append({ results.append({
'id': link['href'].replace('/torrent/', ''), 'id': link['href'].replace('/torrent/', ''),
'name': link.string, 'name': unicode(link.string),
'url': self.urls['download'] % url['href'], 'url': self.urls['download'] % url['href'],
'detail_url': self.urls['download'] % details['href'], 'detail_url': self.urls['download'] % details['href'],
'size': self.parseSize(result.find_all('td')[4].string), 'size': self.parseSize(result.find_all('td')[4].string),