From c235e869a50d8783b01f5a46d5b93e171cbbb71e Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 12 Apr 2013 15:30:17 +0200 Subject: New debrid: MultiDebridCom http://forum.pyload.org/viewtopic.php?f=13&t=2426 --- module/plugins/accounts/MultiDebridCom.py | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 module/plugins/accounts/MultiDebridCom.py (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/MultiDebridCom.py b/module/plugins/accounts/MultiDebridCom.py new file mode 100644 index 000000000..904be5ee7 --- /dev/null +++ b/module/plugins/accounts/MultiDebridCom.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- + +############################################################################ +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU Affero General Public License as # +# published by the Free Software Foundation, either version 3 of the # +# License, or (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Affero General Public License for more details. # +# # +# You should have received a copy of the GNU Affero General Public License # +# along with this program. If not, see . # +############################################################################ + +from time import time + +from module.plugins.Account import Account +from module.common.json_layer import json_loads + + +class MultiDebridCom(Account): + __name__ = "MultiDebridCom" + __version__ = "0.01" + __type__ = "account" + __description__ = """Multi-debrid.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'] * 86400) + 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://multi-debrid.com/myaccount + self.html = req.load("http://multi-debrid.com/api.php", + get={"user": user, "pass": data["password"]}) + self.logDebug('JSON data: ' + self.html) + self.json_data = json_loads(self.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() -- cgit v1.2.3 From 726370725997433a816720b9078a102a6a3dc26e Mon Sep 17 00:00:00 2001 From: Stefano Date: Fri, 26 Apr 2013 17:29:33 +0300 Subject: RapidgatorNet: convert unicode to integer http://forum.pyload.org/viewtopic.php?f=10&t=2466 --- module/plugins/accounts/RapidgatorNet.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/RapidgatorNet.py b/module/plugins/accounts/RapidgatorNet.py index 74825a0f9..85adc71a3 100644 --- a/module/plugins/accounts/RapidgatorNet.py +++ b/module/plugins/accounts/RapidgatorNet.py @@ -24,7 +24,7 @@ from module.common.json_layer import json_loads class RapidgatorNet(Account): __name__ = "RapidgatorNet" - __version__ = "0.03" + __version__ = "0.04" __type__ = "account" __description__ = """rapidgator.net account plugin""" __author_name__ = ("zoidberg") @@ -46,7 +46,7 @@ class RapidgatorNet(Account): self.scheduleRefresh(user, json['response']['reset_in']) return {"validuntil": json['response']['expire_date'], - "trafficleft": json['response']['traffic_left'] / 1024, + "trafficleft": int(json['response']['traffic_left']) / 1024, "premium": True} else: self.logError(json['response_details']) @@ -71,4 +71,4 @@ class RapidgatorNet(Account): except Exception, e: self.logError(e) - self.wrongPassword() \ No newline at end of file + self.wrongPassword() -- cgit v1.2.3 From e1f79ddb61fb454494b3c8fd7c97df3be0387770 Mon Sep 17 00:00:00 2001 From: Stefano Date: Tue, 14 May 2013 12:13:31 +0200 Subject: FilefactoryCom: fixed validuntil parser --- module/plugins/accounts/FilefactoryCom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module/plugins/accounts') diff --git a/module/plugins/accounts/FilefactoryCom.py b/module/plugins/accounts/FilefactoryCom.py index 356c5d22a..8e163e2f6 100644 --- a/module/plugins/accounts/FilefactoryCom.py +++ b/module/plugins/accounts/FilefactoryCom.py @@ -23,13 +23,13 @@ from time import mktime, strptime class FilefactoryCom(Account): __name__ = "FilefactoryCom" - __version__ = "0.12" + __version__ = "0.13" __type__ = "account" __description__ = """filefactory.com account plugin""" - __author_name__ = ("zoidberg") - __author_mail__ = ("zoidberg@mujmail.cz") + __author_name__ = ("zoidberg", "stickell") + __author_mail__ = ("zoidberg@mujmail.cz", "l.stickell@yahoo.it") - ACCOUNT_INFO_PATTERN = r'.*?datetime="(.*?)"' + ACCOUNT_INFO_PATTERN = r'