aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Lyon <matthewlyon18@gmail.com>2019-12-25 17:57:37 +0000
committerMatt Lyon <matthewlyon18@gmail.com>2019-12-25 17:57:37 +0000
commit87155dd4b37234628aebc41fcce123da439b5566 (patch)
tree3506598f3acb1901f4bfbfe499f29129593d8e8f
parentba5437c656c479c36a7eb460d0b521898c11d0f6 (diff)
downloadtpb-lite-v.0.3.0.tar.gz
tpb-lite-v.0.3.0.tar.bz2
tpb-lite-v.0.3.0.zip
updated README, added some commentsv.0.3.0
-rw-r--r--README.md14
-rw-r--r--setup.py2
-rw-r--r--tpblite/tpblite.py20
3 files changed, 26 insertions, 10 deletions
diff --git a/README.md b/README.md
index eb64e08..22e725f 100644
--- a/README.md
+++ b/README.md
@@ -48,11 +48,23 @@ torrent = torrents[3]
print(torrent.magnetlink)
```
## Browse
-Alternatively you can browse all of the torrents from a single category.
```python
+# You can browse all of the torrents from a single category
+torrents = t.browse(category=CATEGORIES.VIDEOS)
+# Customize the page number and sort order
torrents = t.browse(category=CATEGORIES.VIDEO.MOVIES, page=1, order=ORDERS.UPLOADED.DES)
```
+## Categories and Sort Order
+```python
+# To print all available categories, use the classmethod printOptions
+CATEGORIES.printOptions()
+# Or just a subset of categories, like VIDEOS
+CATEGORIES.VIDEO.printOptions()
+# Similarly for the sort order
+ORDERS.printOptions()
+```
+
## Torrents object
The search function returns a `Torrents` object, which is a *list-like* collection of the torrents found.
diff --git a/setup.py b/setup.py
index 8b3f4d2..4a48939 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ this_dir = path.abspath(path.dirname(__file__))
with open(path.join(this_dir, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
-version = '0.2.4'
+version = '0.3.0'
setup(name = 'tpblite',
version = version,
diff --git a/tpblite/tpblite.py b/tpblite/tpblite.py
index 3c68d62..1ec3991 100644
--- a/tpblite/tpblite.py
+++ b/tpblite/tpblite.py
@@ -29,12 +29,14 @@ class TPB:
Args:
query: Search string to query ThePirateBay
- page: page number to grab results from
- order TODO
- category TODO
+ page: Page number to grab results from
+ order: Order of results, default is ascending. List of possible options found in
+ tpblite.models.constants.ORDERS
+ category: Restrict search to specific category, for list of categories see
+ tpblite.models.constants.CATEGORIES
Return:
- Torrents
+ Torrents object
"""
q = QueryParser.search(query, self.base_url, page, order, category)
@@ -46,12 +48,14 @@ class TPB:
Args:
query: Search string to query ThePirateBay
- page: page number to grab results from
- order TODO
- category TODO
+ page: Page number to grab results from
+ order: Order of results, default is ascending. List of possible options found in
+ tpblite.models.constants.ORDERS
+ category: Restrict search to specific category, for list of categories see
+ tpblite.models.constants.CATEGORIES
Return:
- Torrent
+ Torrents object
"""
q = QueryParser.browse(self.base_url, category, page, order)