diff options
author | mattlyon93 <matthewlyon18@gmail.com> | 2019-11-03 12:29:00 +1100 |
---|---|---|
committer | mattlyon93 <matthewlyon18@gmail.com> | 2019-11-03 12:29:00 +1100 |
commit | a3fa73495141fc240ea0ad9b54d7a2882264db20 (patch) | |
tree | ba17da28c7209d4a667e9d34e180199c6aed61ab /tpblite/tpblite.py | |
parent | 612087fd74b849525c32dfc4033603808b0c2433 (diff) | |
download | tpb-lite-a3fa73495141fc240ea0ad9b54d7a2882264db20.tar.gz tpb-lite-a3fa73495141fc240ea0ad9b54d7a2882264db20.tar.bz2 tpb-lite-a3fa73495141fc240ea0ad9b54d7a2882264db20.zip |
improvements to TPB controller and Query
Diffstat (limited to 'tpblite/tpblite.py')
-rw-r--r-- | tpblite/tpblite.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tpblite/tpblite.py b/tpblite/tpblite.py index c99bfd2..0bee91a 100644 --- a/tpblite/tpblite.py +++ b/tpblite/tpblite.py @@ -5,10 +5,15 @@ class TPB(object): def __init__(self, base_url='https://tpb.party'): self.base_url = base_url + self.search_url = None - def search(self, query, base_url, page=0, order=99, category=0): - webpage = Query(query, base_url, page=0, order=99, category=0) - return Torrents(webpage) + def __str__(self): + 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) + self.search_url = q.url + return Torrents(q.html_source) def run(): q = Query('avengers endgame 1080p') |