diff options
author | synweap15 <shamdog+github@gmail.com> | 2014-07-09 13:47:49 +0200 |
---|---|---|
committer | synweap15 <shamdog+github@gmail.com> | 2014-07-09 13:47:49 +0200 |
commit | 2e8ed2bf0b357e907f6921c7bb88719bb347367b (patch) | |
tree | d938b32f0b55fe708dc4306f74ea32f1c00458e0 | |
parent | remove enviroment line (diff) | |
download | pyload-2e8ed2bf0b357e907f6921c7bb88719bb347367b.tar.xz |
remove blank lines and unused imports
-rw-r--r-- | module/plugins/accounts/RapideoPl.py | 26 | ||||
-rw-r--r-- | module/plugins/hooks/RapideoPl.py | 3 | ||||
-rw-r--r-- | module/plugins/hoster/RapideoPl.py | 2 |
3 files changed, 9 insertions, 22 deletions
diff --git a/module/plugins/accounts/RapideoPl.py b/module/plugins/accounts/RapideoPl.py index 0463bba69..853731f26 100644 --- a/module/plugins/accounts/RapideoPl.py +++ b/module/plugins/accounts/RapideoPl.py @@ -3,9 +3,7 @@ from datetime import datetime from module.plugins.Account import Account -from module.plugins.internal.SimpleHoster import parseHtmlForm -import re -from time import mktime, strptime +from time import mktime import module.lib.beaker.crypto as crypto try: @@ -13,6 +11,7 @@ try: except ImportError: from simplejson import loads + class RapideoPl(Account): __name__ = "RapideoPl" __version__ = "0.01" @@ -37,40 +36,32 @@ class RapideoPl(Account): _pwd = None def loadAccountInfo(self, name, req): - self._req = req - try: result = loads(self.runAuthQuery()) except: - #todo: return or let it be thrown? + # todo: return or let it be thrown? return premium = False valid_untill = -1 - is_premium = "expire" in result.keys() and result["expire"] is not None - if is_premium: - premium = True valid_untill = mktime(datetime.fromtimestamp(int(result["expire"])).timetuple()) traffic_left = result["balance"] return ({ - "validuntil": valid_untill, - "trafficleft": traffic_left, - "premium": premium - }) + "validuntil": valid_untill, + "trafficleft": traffic_left, + "premium": premium + }) def login(self, user, data, req): - self._usr = user self._pwd = crypto.md5(data["password"]).hexdigest() - self._req = req - try: response = loads(self.runAuthQuery()) except: @@ -78,12 +69,10 @@ class RapideoPl(Account): if "errno" in response.keys(): self.wrongPassword() - data['usr'] = self._usr data['pwd'] = self._pwd def createAuthQuery(self): - query = self._api_query query["username"] = self._usr query["password"] = self._pwd @@ -91,7 +80,6 @@ class RapideoPl(Account): return query def runAuthQuery(self): - data = self._req.load(self._api_url, post=self.createAuthQuery()) return data
\ No newline at end of file diff --git a/module/plugins/hooks/RapideoPl.py b/module/plugins/hooks/RapideoPl.py index fa3df9f84..de1a80908 100644 --- a/module/plugins/hooks/RapideoPl.py +++ b/module/plugins/hooks/RapideoPl.py @@ -8,6 +8,7 @@ try: except ImportError: from simplejson import loads + class RapideoPl(MultiHoster): __name__ = "RapideoPl" __version__ = "0.01" @@ -24,8 +25,8 @@ class RapideoPl(MultiHoster): __author_mail__ = ("dev@rapideo.pl") def getHoster(self): - hostings = loads(getURL("https://www.rapideo.pl/clipboard.php?json=3").strip()) + return [domain for row in hostings for domain in row["domains"] if row["sdownload"] == "0"] def getHosterCached(self): diff --git a/module/plugins/hoster/RapideoPl.py b/module/plugins/hoster/RapideoPl.py index b7deaa8ed..587b00bca 100644 --- a/module/plugins/hoster/RapideoPl.py +++ b/module/plugins/hoster/RapideoPl.py @@ -52,9 +52,7 @@ class RapideoPl(SimpleHoster): return self.load(self._api_url, post=query) def process(self, pyfile): - self.get_username_password() - try: data = self.runFileQuery(pyfile.url, 'fileinfo') except Exception as e: |