diff options
author | Uri Goldberg <uri.goldberg06@gmail.com> | 2020-11-08 17:27:09 -0600 |
---|---|---|
committer | Uri Goldberg <uri.goldberg06@gmail.com> | 2020-11-08 17:27:09 -0600 |
commit | 46101cdc039c8ff0f90145e78628dd5c0235529b (patch) | |
tree | 7264802f8309b83de9997261070320830b815493 | |
parent | 92bd0c22026cabd72b32194520ff7d810823b81a (diff) | |
download | tpb-lite-46101cdc039c8ff0f90145e78628dd5c0235529b.tar.gz tpb-lite-46101cdc039c8ff0f90145e78628dd5c0235529b.tar.bz2 tpb-lite-46101cdc039c8ff0f90145e78628dd5c0235529b.zip |
Added functionality for knowing which torrents are from trusted or VIP sources
-rw-r--r-- | tpblite/models/torrents.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tpblite/models/torrents.py b/tpblite/models/torrents.py index 4803740..38e8149 100644 --- a/tpblite/models/torrents.py +++ b/tpblite/models/torrents.py @@ -34,6 +34,8 @@ class Torrent: ) = self._getFileInfo() self.magnetlink = self._getMagnetLink() self.url = self._getUrl() + self.is_vip = self._getVip() + self.is_trusted = self._getTrusted() def __str__(self): return "{0}, S: {1}, L: {2}, {3}".format( @@ -67,6 +69,17 @@ class Torrent: tag = self.html_row.find('.//a[@class="detLink"]') return tag.get("href") + def _getVip(self): + image_name = self.html_row.xpath('.//img/@src')[1] + print('shalom') + print(image_name) + return 'vip' in image_name + + def _getTrusted(self): + image_name = self.html_row.xpath('.//img/@src')[1] + print(image_name) + return 'trusted' in image_name + class Torrents: """ |