From 46101cdc039c8ff0f90145e78628dd5c0235529b Mon Sep 17 00:00:00 2001 From: Uri Goldberg Date: Sun, 8 Nov 2020 17:27:09 -0600 Subject: Added functionality for knowing which torrents are from trusted or VIP sources --- tpblite/models/torrents.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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: """ -- cgit v1.2.3 From 82bfbfeff606b7b56b8cade227389f1e5b2d1168 Mon Sep 17 00:00:00 2001 From: Uri Goldberg Date: Sun, 8 Nov 2020 17:31:06 -0600 Subject: Deleted prints --- tpblite/models/torrents.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tpblite/models/torrents.py b/tpblite/models/torrents.py index 38e8149..3d6fc10 100644 --- a/tpblite/models/torrents.py +++ b/tpblite/models/torrents.py @@ -71,13 +71,10 @@ class Torrent: 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 -- cgit v1.2.3