diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 13:35:34 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-09-14 13:35:34 +0200 |
commit | 1066d65b9ed19d8e1b061c13fc0156d823fea800 (patch) | |
tree | 4c1fcd3b0660d2ccb3ce4d2abc0077f1a7876725 /pyload/plugins/accounts/MyfastfileCom.py | |
parent | Docs cleanup + remove script directory (diff) | |
parent | [FTP] Restore pattern. (diff) | |
download | pyload-1066d65b9ed19d8e1b061c13fc0156d823fea800.tar.xz |
Merge remote-tracking branch 'pyload/stable' into 0.4.10
Conflicts:
module/plugins/accounts/MultiDebridCom.py
module/plugins/accounts/MyfastfileCom.py
module/plugins/hooks/MultiDebridCom.py
module/plugins/hooks/MyfastfileCom.py
module/plugins/hooks/Premium4Me.py
module/plugins/hooks/PremiumTo.py
module/plugins/hoster/MultiDebridCom.py
module/plugins/hoster/MyfastfileCom.py
module/plugins/hoster/Premium4Me.py
module/plugins/hoster/PremiumTo.py
pyload/plugins/accounts/MultiDebridCom.py
pyload/plugins/accounts/Premium4Me.py
pyload/plugins/hooks/MultiDebridCom.py
pyload/plugins/hooks/Premium4Me.py
pyload/plugins/hoster/MultiDebridCom.py
pyload/plugins/hoster/Premium4Me.py
Diffstat (limited to 'pyload/plugins/accounts/MyfastfileCom.py')
-rw-r--r-- | pyload/plugins/accounts/MyfastfileCom.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/pyload/plugins/accounts/MyfastfileCom.py b/pyload/plugins/accounts/MyfastfileCom.py new file mode 100644 index 000000000..b5d35d326 --- /dev/null +++ b/pyload/plugins/accounts/MyfastfileCom.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- + +from time import time + +from pyload.plugins.Account import Account +from pyload.utils import json_loads + + +class MyfastfileCom(Account): + __name__ = "MyfastfileCom" + __type__ = "account" + __version__ = "0.02" + + __description__ = """Myfastfile.com account plugin""" + __author_name__ = "stickell" + __author_mail__ = "l.stickell@yahoo.it" + + + def loadAccountInfo(self, user, req): + if 'days_left' in self.json_data: + validuntil = int(time() + self.json_data['days_left'] * 24 * 60 * 60) + return {"premium": True, "validuntil": validuntil, "trafficleft": -1} + else: + self.logError('Unable to get account information') + + def login(self, user, data, req): + # Password to use is the API-Password written in http://myfastfile.com/myaccount + html = req.load("http://myfastfile.com/api.php", + get={"user": user, "pass": data['password']}) + self.logDebug('JSON data: ' + html) + self.json_data = json_loads(html) + if self.json_data['status'] != 'ok': + self.logError('Invalid login. The password to use is the API-Password you find in your "My Account" page') + self.wrongPassword() |