diff options
author | Loic Coyle <loic.coyle@hotmail.fr> | 2020-08-22 18:46:58 +0200 |
---|---|---|
committer | Loic Coyle <loic.coyle@hotmail.fr> | 2020-08-22 18:46:58 +0200 |
commit | e9e1c637b95f609a3053c243f2f5837d5214f3c0 (patch) | |
tree | 45ad959e3d0940df8add76e3a70c8f0c4ce19e5e /tpblite/models | |
parent | e2a941fbfc032e1aa57994879c43ab0585324346 (diff) | |
download | tpb-lite-e9e1c637b95f609a3053c243f2f5837d5214f3c0.tar.gz tpb-lite-e9e1c637b95f609a3053c243f2f5837d5214f3c0.tar.bz2 tpb-lite-e9e1c637b95f609a3053c243f2f5837d5214f3c0.zip |
add url attribute to Torrent
Diffstat (limited to 'tpblite/models')
-rw-r--r-- | tpblite/models/torrents.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tpblite/models/torrents.py b/tpblite/models/torrents.py index ada282f..5145289 100644 --- a/tpblite/models/torrents.py +++ b/tpblite/models/torrents.py @@ -33,6 +33,7 @@ class Torrent: self._getFileInfo() ) self.magnetlink = self._getMagnetLink() + self.url = self._getUrl() def __str__(self): return "{0}, S: {1}, L: {2}, {3}".format( @@ -63,10 +64,14 @@ class Torrent: uploader = unicodedata.normalize("NFKD", t[2].replace("ULed by ", "").strip()) return uptime, size, byte_size, uploader + def _getUrl(self): + tag = self.html_row.find("a", class_="detLink") + return tag.get("href") + class Torrents: """ - Torrent object, takes query response and parses into + Torrent object, takes query response and parses into torrent list or dict. Has methods to select items from torrent list. """ |