aboutsummaryrefslogtreecommitdiffstats
path: root/tpblite/tpblite.py
diff options
context:
space:
mode:
authorJPFrancoia <jeanpatrick.francoia@gmail.com>2019-12-25 17:11:09 +0100
committerJPFrancoia <jeanpatrick.francoia@gmail.com>2019-12-25 17:11:09 +0100
commit4418d8c73b26639016733bc0a3264a96046c6ab1 (patch)
treec2aa2b2636acd81e78223284e8ad616ad250bb3a /tpblite/tpblite.py
parentfdb0167687f1772ff4b2363010e417234061af04 (diff)
downloadtpb-lite-4418d8c73b26639016733bc0a3264a96046c6ab1.tar.gz
tpb-lite-4418d8c73b26639016733bc0a3264a96046c6ab1.tar.bz2
tpb-lite-4418d8c73b26639016733bc0a3264a96046c6ab1.zip
Fixing mistakes related to type hinting.
Diffstat (limited to 'tpblite/tpblite.py')
-rw-r--r--tpblite/tpblite.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/tpblite/tpblite.py b/tpblite/tpblite.py
index e4a0c58..3c68d62 100644
--- a/tpblite/tpblite.py
+++ b/tpblite/tpblite.py
@@ -6,9 +6,6 @@ from .models.utils import QueryParser
class TPB:
- # PirateBay URL to use for queries
- base_url: str
-
def __init__(self, base_url: str = "https://tpb.party"):
"""ThePirateBay Object
@@ -16,6 +13,7 @@ class TPB:
base_url (str): PirateBay URL to use for queries
"""
+ # PirateBay URL to use for queries
self.base_url = base_url
# Compiled search string used to query the PirateBay URL
@@ -26,7 +24,7 @@ class TPB:
def search(
self, query: str, page: int = 0, order: int = 99, category: int = 0
- ) -> Torrent:
+ ) -> Torrents:
"""Search ThePirateBay and return list of Torrents
Args:
@@ -36,14 +34,14 @@ class TPB:
category TODO
Return:
- Torrent
+ Torrents
"""
- q = QueryParser.from_search(query, self.base_url, page, order, category)
+ q = QueryParser.search(query, self.base_url, page, order, category)
self._search_url = q.url
return Torrents(q.html_source)
- def browse(self, category: int = 0, page: int = 0, order: int = 99) -> Torrent:
+ def browse(self, category: int = 0, page: int = 0, order: int = 99) -> Torrents:
"""Browse ThePirateBay and return list of Torrents
Args:
@@ -56,6 +54,6 @@ class TPB:
Torrent
"""
- q = QueryParser.from_browse(self.base_url, category, page, order)
+ q = QueryParser.browse(self.base_url, category, page, order)
self._search_url = q.url
return Torrents(q.html_source)