diff options
Diffstat (limited to 'module/plugins/accounts')
| -rw-r--r-- | module/plugins/accounts/DebridItaliaCom.py | 15 | ||||
| -rw-r--r-- | module/plugins/accounts/MultiDebridCom.py | 47 | ||||
| -rw-r--r-- | module/plugins/accounts/RarefileNet.py | 4 | 
3 files changed, 64 insertions, 2 deletions
| diff --git a/module/plugins/accounts/DebridItaliaCom.py b/module/plugins/accounts/DebridItaliaCom.py index d68f1c8a8..91dd3787f 100644 --- a/module/plugins/accounts/DebridItaliaCom.py +++ b/module/plugins/accounts/DebridItaliaCom.py @@ -1,5 +1,20 @@  # -*- 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 <http://www.gnu.org/licenses/>.    # +############################################################################ +  import re  import _strptime  import time 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 <http://www.gnu.org/licenses/>.    # +############################################################################ + +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() diff --git a/module/plugins/accounts/RarefileNet.py b/module/plugins/accounts/RarefileNet.py index 57f293c55..90ad02d43 100644 --- a/module/plugins/accounts/RarefileNet.py +++ b/module/plugins/accounts/RarefileNet.py @@ -3,10 +3,10 @@ from module.plugins.internal.XFSPAccount import XFSPAccount  class RarefileNet(XFSPAccount):      __name__ = "RarefileNet" -    __version__ = "0.01" +    __version__ = "0.02"      __type__ = "account"      __description__ = """RareFile.net account plugin"""      __author_name__ = ("zoidberg")      __author_mail__ = ("zoidberg@mujmail.cz") -    MAIN_PAGE = "http://rarefile.in/"
\ No newline at end of file +    MAIN_PAGE = "http://rarefile.net/" | 
