aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJPFrancoia <jeanpatrick.francoia@gmail.com>2019-12-25 11:54:00 +0100
committerJPFrancoia <jeanpatrick.francoia@gmail.com>2019-12-25 11:54:00 +0100
commitfdb0167687f1772ff4b2363010e417234061af04 (patch)
treebac85f962db46320cb46bf5e64f448540b3dc8a7
parent836fa075264a1d1f43a434c2e134d6bf6cb57943 (diff)
downloadtpb-lite-fdb0167687f1772ff4b2363010e417234061af04.tar.gz
tpb-lite-fdb0167687f1772ff4b2363010e417234061af04.tar.bz2
tpb-lite-fdb0167687f1772ff4b2363010e417234061af04.zip
search_url is now a private atttribute and was renamed _search_url.
-rw-r--r--tpblite/tpblite.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/tpblite/tpblite.py b/tpblite/tpblite.py
index 9d153ac..e4a0c58 100644
--- a/tpblite/tpblite.py
+++ b/tpblite/tpblite.py
@@ -9,10 +9,7 @@ class TPB:
# PirateBay URL to use for queries
base_url: str
- # Compiled search string used to query the PirateBay URL
- search_url: Optional[str]
-
- def __init__(self, base_url="https://tpb.party"):
+ def __init__(self, base_url: str = "https://tpb.party"):
"""ThePirateBay Object
Args:
@@ -20,7 +17,9 @@ class TPB:
"""
self.base_url = base_url
- self.search_url = None
+
+ # Compiled search string used to query the PirateBay URL
+ self._search_url: Optional[str] = None
def __str__(self) -> str:
return "TPB Object, base URL: {}".format(self.base_url)
@@ -41,12 +40,10 @@ class TPB:
"""
q = QueryParser.from_search(query, self.base_url, page, order, category)
- self.search_url = q.url
+ 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) -> Torrent:
"""Browse ThePirateBay and return list of Torrents
Args:
@@ -60,5 +57,5 @@ class TPB:
"""
q = QueryParser.from_browse(self.base_url, category, page, order)
- self.search_url = q.url
+ self._search_url = q.url
return Torrents(q.html_source)