Private GIT

Skip to content
Snippets Groups Projects
Commit 7c070cd4 authored by supergonkas's avatar supergonkas
Browse files

Clean up the code and add REAL to proper string

parent 989f2a91
Branches
Tags
No related merge requests found
...@@ -42,7 +42,7 @@ class LimeTorrentsProvider(TorrentProvider): # pylint: disable=too-many-instance ...@@ -42,7 +42,7 @@ class LimeTorrentsProvider(TorrentProvider): # pylint: disable=too-many-instance
self.minseed = None self.minseed = None
self.minleech = None self.minleech = None
self.headers.update({'User-Agent': USER_AGENT}) self.headers.update({'User-Agent': USER_AGENT})
self.proper_strings = ['PROPER', 'REPACK'] self.proper_strings = ['PROPER', 'REPACK', 'REAL']
self.cache = LimeTorrentsCache(self) self.cache = LimeTorrentsCache(self)
...@@ -90,15 +90,13 @@ class LimeTorrentsProvider(TorrentProvider): # pylint: disable=too-many-instance ...@@ -90,15 +90,13 @@ class LimeTorrentsProvider(TorrentProvider): # pylint: disable=too-many-instance
# Category: <a href="http://www.limetorrents.cc/browse-torrents/TV-shows/">TV shows</a><br /> Seeds: 1<br />Leechers: 0<br />Size: 7.71 GB<br /><br /><a href="http://www.limetorrents.cc/Owen-Hart-of-Gold-Djon91-torrent-7180661.html">More @ limetorrents.cc</a><br /> # Category: <a href="http://www.limetorrents.cc/browse-torrents/TV-shows/">TV shows</a><br /> Seeds: 1<br />Leechers: 0<br />Size: 7.71 GB<br /><br /><a href="http://www.limetorrents.cc/Owen-Hart-of-Gold-Djon91-torrent-7180661.html">More @ limetorrents.cc</a><br />
# ]]> # ]]>
description = item.find('description') description = item.find('description')
smtg = (description.find_all('br')[0].next_sibling).strip() seeders = description.find_all('br')[0].next_sibling.strip().lstrip('Seeds: ')
smtg2 = (description.find_all('br')[1].next_sibling).strip() leechers = description.find_all('br')[1].next_sibling.strip().lstrip('Leechers: ')
seeders = smtg.lstrip('Seeds: ')
leechers = smtg2.lstrip('Leechers: ')
else: else:
#<description>Seeds: 6982 , Leechers 734</description> #<description>Seeds: 6982 , Leechers 734</description>
description = item.find('description').text description = item.find('description').text.partition(',')
seeders = description.split("Seeds: ")[-1].split()[0] seeders = description[0].lstrip('Seeds: ').strip()
leechers = description.split("Leechers ")[-1].split()[0] leechers = description[2].lstrip('Leechers ').strip()
size = try_int(item.find('size').text, -1) size = try_int(item.find('size').text, -1)
except (AttributeError, TypeError, KeyError, ValueError): except (AttributeError, TypeError, KeyError, ValueError):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment