From 4d6f805c40f48cda9c57bc2e4a8f09bc37e046ec Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 20 Jul 2013 20:43:35 +0200 Subject: Simplydebrid: renamed to standard --- module/plugins/accounts/SimplydebridCOM.py | 30 -------------------- module/plugins/accounts/SimplydebridCom.py | 30 ++++++++++++++++++++ module/plugins/hooks/SimplydebridCOM.py | 20 ------------- module/plugins/hooks/SimplydebridCom.py | 20 +++++++++++++ module/plugins/hoster/SimplydebridCOM.py | 45 ------------------------------ module/plugins/hoster/SimplydebridCom.py | 45 ++++++++++++++++++++++++++++++ 6 files changed, 95 insertions(+), 95 deletions(-) delete mode 100644 module/plugins/accounts/SimplydebridCOM.py create mode 100644 module/plugins/accounts/SimplydebridCom.py delete mode 100644 module/plugins/hooks/SimplydebridCOM.py create mode 100644 module/plugins/hooks/SimplydebridCom.py delete mode 100644 module/plugins/hoster/SimplydebridCOM.py create mode 100644 module/plugins/hoster/SimplydebridCom.py diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py deleted file mode 100644 index 2b14a37c2..000000000 --- a/module/plugins/accounts/SimplydebridCOM.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from time import mktime, strptime - -from module.plugins.Account import Account - - -class SimplydebridCOM(Account): - __name__ = "SimplydebridCOM" - __version__ = "0.1" - __type__ = "account" - __description__ = """Simply-Debrid.com account plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def loadAccountInfo(self, user, req): - get_data = {'login': 2, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - data = [x.strip() for x in response.split(";")] - if str(data[0]) != "1": - return {"premium": False} - else: - return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} - - def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - get_data = {'login': 1, 'u': self.loginname, 'p': self.password} - response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) - if response != "02: loggin success": - self.wrongPassword() diff --git a/module/plugins/accounts/SimplydebridCom.py b/module/plugins/accounts/SimplydebridCom.py new file mode 100644 index 000000000..82b499bbd --- /dev/null +++ b/module/plugins/accounts/SimplydebridCom.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from time import mktime, strptime + +from module.plugins.Account import Account + + +class SimplydebridCom(Account): + __name__ = "SimplydebridCom" + __version__ = "0.1" + __type__ = "account" + __description__ = """Simply-Debrid.com account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def loadAccountInfo(self, user, req): + get_data = {'login': 2, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + data = [x.strip() for x in response.split(";")] + if str(data[0]) != "1": + return {"premium": False} + else: + return {"trafficleft": -1, "validuntil": mktime(strptime(str(data[2]), "%d/%m/%Y"))} + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + get_data = {'login': 1, 'u': self.loginname, 'p': self.password} + response = req.load("http://simply-debrid.com/api.php", get=get_data, decode=True) + if response != "02: loggin success": + self.wrongPassword() diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py deleted file mode 100644 index b45d289ee..000000000 --- a/module/plugins/hooks/SimplydebridCOM.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- - -from module.network.RequestFactory import getURL -from module.plugins.internal.MultiHoster import MultiHoster - - -class SimplydebridCOM(MultiHoster): - __name__ = "SimplydebridCOM" - __version__ = "0.01" - __type__ = "hook" - __config__ = [("activated", "bool", "Activated", "False"), - ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), - ("hosterList", "str", "Hoster list (comma separated)", "")] - __description__ = """Simply-Debrid.com hook plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def getHoster(self): - page = getURL("http://simply-debrid.com/api.php?list=1") - return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hooks/SimplydebridCom.py b/module/plugins/hooks/SimplydebridCom.py new file mode 100644 index 000000000..3272df567 --- /dev/null +++ b/module/plugins/hooks/SimplydebridCom.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +from module.network.RequestFactory import getURL +from module.plugins.internal.MultiHoster import MultiHoster + + +class SimplydebridCom(MultiHoster): + __name__ = "SimplydebridCom" + __version__ = "0.01" + __type__ = "hook" + __config__ = [("activated", "bool", "Activated", "False"), + ("hosterListMode", "all;listed;unlisted", "Use for hosters (if supported)", "all"), + ("hosterList", "str", "Hoster list (comma separated)", "")] + __description__ = """Simply-Debrid.com hook plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def getHoster(self): + page = getURL("http://simply-debrid.com/api.php?list=1") + return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py deleted file mode 100644 index 69c5b8af1..000000000 --- a/module/plugins/hoster/SimplydebridCOM.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -from urllib import quote, unquote -import re - -from module.plugins.Hoster import Hoster - - -class SimplydebridCOM(Hoster): - __name__ = "SimplydebridCOM" - __version__ = "0.1" - __type__ = "hoster" - __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*" - __description__ = """simply-debrid.com hoster plugin""" - __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") - - def setup(self): - self.resumeDownload = self.multiDL = True - self.chunkLimit = 1 - - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) - self.fail("No simply-debrid.com account provided") - - self.logDebug("Old URL: %s" % pyfile.url) - - #fix the links for simply-debrid.com! - new_url = pyfile.url - new_url = new_url.replace("clz.to", "cloudzer.net/file") - new_url = new_url.replace("http://share-online", "http://www.share-online") - - if not re.match(self.__pattern__, new_url): - page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) - if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): - self.fail('Unable to unrestrict link') - new_url = page - - self.setWait(5) - self.wait() - self.logDebug("Unrestricted URL: " + new_url) - - self.download(new_url, disposition=True) diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py new file mode 100644 index 000000000..2dcbd0f21 --- /dev/null +++ b/module/plugins/hoster/SimplydebridCom.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from urllib import quote, unquote +import re + +from module.plugins.Hoster import Hoster + + +class SimplydebridCom(Hoster): + __name__ = "SimplydebridCom" + __version__ = "0.1" + __type__ = "hoster" + __pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*" + __description__ = """simply-debrid.com hoster plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") + + def setup(self): + self.resumeDownload = self.multiDL = True + self.chunkLimit = 1 + + def process(self, pyfile): + if not self.account: + self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) + self.fail("No simply-debrid.com account provided") + + self.logDebug("Old URL: %s" % pyfile.url) + + #fix the links for simply-debrid.com! + new_url = pyfile.url + new_url = new_url.replace("clz.to", "cloudzer.net/file") + new_url = new_url.replace("http://share-online", "http://www.share-online") + + if not re.match(self.__pattern__, new_url): + page = self.load('http://simply-debrid.com/api.php', get={'dl': new_url}) #+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): + self.fail('Unable to unrestrict link') + new_url = page + + self.setWait(5) + self.wait() + self.logDebug("Unrestricted URL: " + new_url) + + self.download(new_url, disposition=True) -- cgit v1.2.3