diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,5 +1,7 @@ Unofficial Lightweight Python API for ThePirateBay +[![PyPI version](https://badge.fury.io/py/tpblite.png)](https://badge.fury.io/py/tpblite) + Installation ============= ```sh @@ -55,6 +57,18 @@ torrents = t.browse(category=CATEGORIES.VIDEOS) torrents = t.browse(category=CATEGORIES.VIDEO.MOVIES, page=1, order=ORDERS.UPLOADED.DES) ``` +## Top +```python +from tpblite import TPB, CATEGORIES +t = TPB() + +# Get the top recent torrents +torrents = t.top(CATEGORIES.GAMES.ALL) + +# Customize with category and restriction to torrents from the last 48h +torrents = t.top(category=CATEGORIES.GAMES.ALL, last_48=True) +``` + ## Categories and Sort Order ```python # To print all available categories, use the classmethod printOptions @@ -74,6 +88,7 @@ You can see how many `Torrent` objects your query has returned, by using the `le ## Torrent object `Torrent` objects represent each torrent found in the `Torrents` class, they have the following attributes + ### Attributes - `Torrent.title` - The name of the torrent (str) - `Torrent.seeds` - The number of seeders (int) @@ -85,7 +100,6 @@ You can see how many `Torrent` objects your query has returned, by using the `le - `Torrent.magnetlink` - magnetlink of the torrent (str) - `Torrent.url` - url of the torrent page (str) - Example Workflow ========== |