diff options
Diffstat (limited to 'tpblite/models/torrents.py')
-rw-r--r-- | tpblite/models/torrents.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tpblite/models/torrents.py b/tpblite/models/torrents.py index 4803740..3d6fc10 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,14 @@ 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] + return 'vip' in image_name + + def _getTrusted(self): + image_name = self.html_row.xpath('.//img/@src')[1] + return 'trusted' in image_name + class Torrents: """ |