aboutsummaryrefslogtreecommitdiffstats
path: root/tpblite/tpblite.py
diff options
context:
space:
mode:
authorMatt Lyon <matthewlyon18@gmail.com>2019-12-16 11:47:01 +0000
committerMatt Lyon <matthewlyon18@gmail.com>2019-12-16 11:47:01 +0000
commitaa666a65a3c61fce8b103594cc432aaca2644b8e (patch)
treec513995f9b55829e2aba14ddccb2efcaf2a16224 /tpblite/tpblite.py
parent669edd3ea3ded084c03775818710e0eef6e6d92d (diff)
downloadtpb-lite-aa666a65a3c61fce8b103594cc432aaca2644b8e.tar.gz
tpb-lite-aa666a65a3c61fce8b103594cc432aaca2644b8e.tar.bz2
tpb-lite-aa666a65a3c61fce8b103594cc432aaca2644b8e.zip
removed property tags, improved torrent row finding function
Diffstat (limited to 'tpblite/tpblite.py')
-rw-r--r--tpblite/tpblite.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/tpblite/tpblite.py b/tpblite/tpblite.py
index 93c812b..a2a927d 100644
--- a/tpblite/tpblite.py
+++ b/tpblite/tpblite.py
@@ -1,9 +1,19 @@
from .models.torrents import Torrents, Torrent
-from .models.utils import Query
+from .models.utils import QueryParser
class TPB(object):
def __init__(self, base_url='https://tpb.party'):
+ '''ThePirateBay Object
+
+ Args:
+ base_url (str): PirateBay URL to use for queries
+
+ Attributes:
+ search_url (str): This is the compiled search string used
+ to query the PirateBay URL, modified when calling search
+ method
+ '''
self.base_url = base_url
self.search_url = None
@@ -11,6 +21,14 @@ class TPB(object):
return 'TPB Object, base URL: {}'.format(self.base_url)
def search(self, query, page=0, order=99, category=0):
- q = Query(query, self.base_url, page, order, category)
+ '''Search ThePirateBay and retturn list of Torrents
+
+ Args:
+ query (str): Search string to query ThePirateBay
+ page (int): page number to grab results from
+ order TODO
+ category TODO
+ '''
+ q = QueryParser(query, self.base_url, page, order, category)
self.search_url = q.url
- return Torrents(q.html_source) \ No newline at end of file
+ return Torrents(query, q.html_source) \ No newline at end of file