diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-02-16 10:46:28 +0100 |
commit | ce1c2b6b05c08b669357947e61ae40efce7fc50f (patch) | |
tree | 0b5f7996960cf35c4eface53a89eba18a37519b7 /pyload/plugin/account/FilecloudIo.py | |
parent | Fix filename case (diff) | |
download | pyload-ce1c2b6b05c08b669357947e61ae40efce7fc50f.tar.xz |
module temp
Diffstat (limited to 'pyload/plugin/account/FilecloudIo.py')
-rw-r--r-- | pyload/plugin/account/FilecloudIo.py | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/pyload/plugin/account/FilecloudIo.py b/pyload/plugin/account/FilecloudIo.py deleted file mode 100644 index 8169bfdce..000000000 --- a/pyload/plugin/account/FilecloudIo.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- - -from pyload.plugin.Account import Account -from pyload.utils import json_loads - - -class FilecloudIo(Account): - __name__ = "FilecloudIo" - __type__ = "account" - __version__ = "0.02" - - __description__ = """FilecloudIo account plugin""" - __license__ = "GPLv3" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz"), - ("stickell", "l.stickell@yahoo.it")] - - - def loadAccountInfo(self, user, req): - # It looks like the first API request always fails, so we retry 5 times, it should work on the second try - for _i in xrange(5): - rep = req.load("https://secure.filecloud.io/api-fetch_apikey.api", - post={"username": user, "password": self.accounts[user]['password']}) - rep = json_loads(rep) - if rep['status'] == 'ok': - break - elif rep['status'] == 'error' and rep['message'] == 'no such user or wrong password': - self.logError(_("Wrong username or password")) - return {"valid": False, "premium": False} - else: - return {"premium": False} - - akey = rep['akey'] - self.accounts[user]['akey'] = akey # Saved for hoster plugin - rep = req.load("http://api.filecloud.io/api-fetch_account_details.api", - post={"akey": akey}) - rep = json_loads(rep) - - if rep['is_premium'] == 1: - return {"validuntil": int(rep['premium_until']), "trafficleft": -1} - else: - return {"premium": False} - - - def login(self, user, data, req): - req.cj.setCookie("secure.filecloud.io", "lang", "en") - html = req.load('https://secure.filecloud.io/user-login.html') - - if not hasattr(self, "form_data"): - self.form_data = {} - - self.form_data['username'] = user - self.form_data['password'] = data['password'] - - html = req.load('https://secure.filecloud.io/user-login_p.html', - post=self.form_data, - multipart=True) - - self.logged_in = True if "you have successfully logged in - filecloud.io" in html else False - self.form_data = {} |