aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoic Coyle <loic.coyle@hotmail.fr>2020-08-23 15:28:51 +0200
committerLoic Coyle <loic.coyle@hotmail.fr>2020-08-23 15:28:51 +0200
commit5c0bec4d7595be3503f43e3e4bd1427d36610e5a (patch)
tree6e1bb6c7a424f808195ac0ece41d9fa93bc05e6c
parent1b8e16b6cf68fd73b84bbd876ff9a20d43466992 (diff)
downloadtpb-lite-5c0bec4d7595be3503f43e3e4bd1427d36610e5a.tar.gz
tpb-lite-5c0bec4d7595be3503f43e3e4bd1427d36610e5a.tar.bz2
tpb-lite-5c0bec4d7595be3503f43e3e4bd1427d36610e5a.zip
black
-rw-r--r--tpblite/__init__.py2
-rw-r--r--tpblite/models/constants.py23
-rw-r--r--tpblite/models/torrents.py9
-rw-r--r--tpblite/tpblite.py1
4 files changed, 22 insertions, 13 deletions
diff --git a/tpblite/__init__.py b/tpblite/__init__.py
index 6a397d1..47116c6 100644
--- a/tpblite/__init__.py
+++ b/tpblite/__init__.py
@@ -1,2 +1,2 @@
from tpblite.tpblite import TPB
-from tpblite.models.constants import ORDERS, CATEGORIES \ No newline at end of file
+from tpblite.models.constants import ORDERS, CATEGORIES
diff --git a/tpblite/models/constants.py b/tpblite/models/constants.py
index 214b379..be65286 100644
--- a/tpblite/models/constants.py
+++ b/tpblite/models/constants.py
@@ -1,16 +1,23 @@
-
class OPTION:
@classmethod
def printOptions(cls):
- for opt in [x for x in cls.__dict__.keys() if not (x.startswith('__') or x.startswith('printOptions'))]:
- if hasattr(getattr(cls,opt),'__dict__'):
- for sub_opt in [y for y in getattr(cls,opt).__dict__.keys() if not (y.startswith('__') or y.startswith('printOptions'))]:
- print('{}.{}'.format(opt,sub_opt))
+ for opt in [
+ x
+ for x in cls.__dict__.keys()
+ if not (x.startswith("__") or x.startswith("printOptions"))
+ ]:
+ if hasattr(getattr(cls, opt), "__dict__"):
+ for sub_opt in [
+ y
+ for y in getattr(cls, opt).__dict__.keys()
+ if not (y.startswith("__") or y.startswith("printOptions"))
+ ]:
+ print("{}.{}".format(opt, sub_opt))
else:
print(opt)
-class ORDERS(OPTION):
+class ORDERS(OPTION):
class NAME(OPTION):
DES = 1
ASC = 2
@@ -42,7 +49,7 @@ class ORDERS(OPTION):
class CATEGORIES(OPTION):
ALL = 0
-
+
class AUDIO(OPTION):
ALL = 100
MUSIC = 101
@@ -102,4 +109,4 @@ class CATEGORIES(OPTION):
PICTURES = 603
COVERS = 604
PHYSIBLES = 605
- OTHER = 699 \ No newline at end of file
+ OTHER = 699
diff --git a/tpblite/models/torrents.py b/tpblite/models/torrents.py
index 5145289..2a9bffb 100644
--- a/tpblite/models/torrents.py
+++ b/tpblite/models/torrents.py
@@ -29,9 +29,12 @@ class Torrent:
self.html_row = html_row
self.title = self._getTitle()
self.seeds, self.leeches = self._getPeers()
- self.upload_date, self.filesize, self.byte_size, self.uploader = (
- self._getFileInfo()
- )
+ (
+ self.upload_date,
+ self.filesize,
+ self.byte_size,
+ self.uploader,
+ ) = self._getFileInfo()
self.magnetlink = self._getMagnetLink()
self.url = self._getUrl()
diff --git a/tpblite/tpblite.py b/tpblite/tpblite.py
index 9365c7e..00c3849 100644
--- a/tpblite/tpblite.py
+++ b/tpblite/tpblite.py
@@ -75,4 +75,3 @@ class TPB:
q = QueryParser.top(self.base_url, category, last_48)
self._search_url = q.url
return Torrents(q.html_source)
-