aboutsummaryrefslogtreecommitdiffstats
path: root/tpblite/tpblite.py
diff options
context:
space:
mode:
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