From aa666a65a3c61fce8b103594cc432aaca2644b8e Mon Sep 17 00:00:00 2001 From: Matt Lyon Date: Mon, 16 Dec 2019 11:47:01 +0000 Subject: removed property tags, improved torrent row finding function --- tpblite/tpblite.py | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'tpblite/tpblite.py') 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 -- cgit v1.2.3