From 834a315649a0090812118f34618e48aff160c162 Mon Sep 17 00:00:00 2001 From: Ivo Buff Date: Fri, 12 Jul 2013 00:45:36 +0200 Subject: SimplydebridCOM plugin added SimplydebridCOM plugin added --- module/plugins/accounts/SimplydebridCOM.py | 39 +++++++++++++++++++++++ module/plugins/hooks/SimplydebridCOM.py | 19 ++++++++++++ module/plugins/hoster/SimplydebridCOM.py | 50 ++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 module/plugins/accounts/SimplydebridCOM.py create mode 100644 module/plugins/hooks/SimplydebridCOM.py create mode 100644 module/plugins/hoster/SimplydebridCOM.py (limited to 'module') diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py new file mode 100644 index 000000000..1679187f6 --- /dev/null +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from module.plugins.Account import Account + +import re +from time import mktime, strptime + +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 = { + } + response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) + if(response[len(response)-1] == ";"): #remove ; if the v entry ends with ; + response = response[0:len(response)-1] + data = [x.strip() for x in response.split(";")] + if str(data[0]) != "1": + account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + else: + account_info = { + "trafficleft": -1, + "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), + "premium": True + } + return account_info + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + get_data = { + } + response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) + if response != "02: loggin success": + self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py new file mode 100644 index 000000000..af415db23 --- /dev/null +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -0,0 +1,19 @@ +# -*- 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") + if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; + page = page[0:len(page)-1] + return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py new file mode 100644 index 000000000..262b0b607 --- /dev/null +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from module.plugins.Hoster import Hoster +from module.utils import html_unescape +from urllib import quote, unquote +from time import sleep +import re + +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): + #print pyfile.url + 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("simply-debrid.com: 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 re.match(self.__pattern__, new_url): + new_url = new_url + else: + page = self.req.load('http://simply-debrid.com/api.php?dl='+new_url)#+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + if(re.search(r'tiger\sLink',page,re.I) or re.search(r'Invalid\sLink',page,re.I) or (re.search(r'api',page,re.I) and re.search(r'error',page,re.I))): + self.fail('Unable to unrestrict link') + #print page + new_url = page + + #print new_url + self.setWait(5) + self.wait() + self.logDebug("Unrestricted URL: " + new_url) + + self.download(new_url, disposition=True) \ No newline at end of file -- cgit v1.2.3 From 88f6fcac584da7e822d9ac4084553972c521f044 Mon Sep 17 00:00:00 2001 From: Ivo Buff Date: Fri, 12 Jul 2013 11:28:40 +0200 Subject: Cleanup Some cleanup and changed tabs to 4 spaces --- module/plugins/accounts/SimplydebridCOM.py | 56 ++++++++++------------ module/plugins/hooks/SimplydebridCOM.py | 24 +++++----- module/plugins/hoster/SimplydebridCOM.py | 75 ++++++++++++++---------------- 3 files changed, 73 insertions(+), 82 deletions(-) (limited to 'module') diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py index 1679187f6..53d707877 100644 --- a/module/plugins/accounts/SimplydebridCOM.py +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -5,35 +5,29 @@ import re from time import mktime, strptime 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 = { - } - response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) - if(response[len(response)-1] == ";"): #remove ; if the v entry ends with ; - response = response[0:len(response)-1] - data = [x.strip() for x in response.split(";")] - if str(data[0]) != "1": - account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} - else: - account_info = { - "trafficleft": -1, - "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), - "premium": True - } - return account_info + __name__ = "SimplydebridCOM" + __version__ = "0.1" + __type__ = "account" + __description__ = """Simply-Debrid.com account plugin""" + __author_name__ = ("Kagenoshin") + __author_mail__ = ("kagenoshin@gmx.ch") - def login(self, user, data, req): - self.loginname = user - self.password = data["password"] - get_data = { - } - response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, get = get_data, decode = True, just_header = False) - if response != "02: loggin success": - self.wrongPassword() \ No newline at end of file + def loadAccountInfo(self, user, req): + response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + data = [x.strip() for x in response.split(";")] + if str(data[0]) != "1": + account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + else: + account_info = { + "trafficleft": -1, + "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), + "premium": True + } + return account_info + + def login(self, user, data, req): + self.loginname = user + self.password = data["password"] + response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + if response != "02: loggin success": + self.wrongPassword() \ No newline at end of file diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py index af415db23..79083f724 100644 --- a/module/plugins/hooks/SimplydebridCOM.py +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -4,16 +4,16 @@ 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") + __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") - if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; - page = page[0:len(page)-1] - return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file + def getHoster(self): + page = getURL("http://simply-debrid.com/api.php?list=1") + if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; + page = page[0:len(page)-1] + return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py index 262b0b607..c4bce15b1 100644 --- a/module/plugins/hoster/SimplydebridCOM.py +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -8,43 +8,40 @@ from time import sleep import re 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): - #print pyfile.url - 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("simply-debrid.com: 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 re.match(self.__pattern__, new_url): - new_url = new_url - else: - page = self.req.load('http://simply-debrid.com/api.php?dl='+new_url)#+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) - if(re.search(r'tiger\sLink',page,re.I) or re.search(r'Invalid\sLink',page,re.I) or (re.search(r'api',page,re.I) and re.search(r'error',page,re.I))): - self.fail('Unable to unrestrict link') - #print page - new_url = page - - #print new_url - self.setWait(5) - self.wait() - self.logDebug("Unrestricted URL: " + new_url) + __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") - self.download(new_url, disposition=True) \ No newline at end of file + 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("simply-debrid.com: 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 re.match(self.__pattern__, new_url): + new_url = new_url + else: + page = self.req.load('http://simply-debrid.com/api.php?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) \ No newline at end of file -- cgit v1.2.3 From abac8315248b6a72b0b4906548d9372f459cdd2e Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 20 Jul 2013 18:14:08 +0200 Subject: Code optimized --- module/plugins/accounts/SimplydebridCOM.py | 18 +++++++++--------- module/plugins/hooks/SimplydebridCOM.py | 8 ++++---- module/plugins/hoster/SimplydebridCOM.py | 20 +++++++++----------- 3 files changed, 22 insertions(+), 24 deletions(-) (limited to 'module') diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py index 53d707877..faa6091c5 100644 --- a/module/plugins/accounts/SimplydebridCOM.py +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -10,24 +10,24 @@ class SimplydebridCOM(Account): __type__ = "account" __description__ = """Simply-Debrid.com account plugin""" __author_name__ = ("Kagenoshin") - __author_mail__ = ("kagenoshin@gmx.ch") + __author_mail__ = ("kagenoshin@gmx.ch") def loadAccountInfo(self, user, req): - response = req.load("http://simply-debrid.com/api.php?login=2&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + 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": - account_info = {"trafficleft": 0, "validuntil": 0, "premium": False} + return {"premium": False} else: - account_info = { + return { "trafficleft": -1, - "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")), - "premium": True + "validuntil": mktime(strptime(str(data[2]),"%d/%m/%Y")) } - return account_info def login(self, user, data, req): self.loginname = user self.password = data["password"] - response = req.load("http://simply-debrid.com/api.php?login=1&u="+self.loginname+"&p="+self.password, decode = True, just_header = False) + 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() \ No newline at end of file + self.wrongPassword() diff --git a/module/plugins/hooks/SimplydebridCOM.py b/module/plugins/hooks/SimplydebridCOM.py index 79083f724..721dce6ca 100644 --- a/module/plugins/hooks/SimplydebridCOM.py +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -7,13 +7,13 @@ 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)", "")] + __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") - if(page[len(page)-1] == ";"): #remove ; if the page entry ends with ; - page = page[0:len(page)-1] - return [x.strip() for x in page.replace("\"","").split(";")] \ No newline at end of file + return [x.strip() for x in page.rstrip(';').replace("\"","").split(";")] diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py index c4bce15b1..499c17145 100644 --- a/module/plugins/hoster/SimplydebridCOM.py +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -24,24 +24,22 @@ class SimplydebridCOM(Hoster): 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("simply-debrid.com: Old URL: %s" % pyfile.url) - + + 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 re.match(self.__pattern__, new_url): - new_url = new_url - else: - page = self.req.load('http://simply-debrid.com/api.php?dl='+new_url)#+'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + + 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) \ No newline at end of file + + self.download(new_url, disposition=True) -- cgit v1.2.3 From 3964f4231fa5ff68b07a50d23d3b233a0735612d Mon Sep 17 00:00:00 2001 From: Stefano Date: Sat, 20 Jul 2013 20:35:18 +0200 Subject: Simplydebrid: fixed syntax error + code reformatted + removed unused imports --- module/plugins/accounts/SimplydebridCOM.py | 13 +++++-------- module/plugins/hooks/SimplydebridCOM.py | 3 ++- module/plugins/hoster/SimplydebridCOM.py | 8 ++++---- 3 files changed, 11 insertions(+), 13 deletions(-) (limited to 'module') diff --git a/module/plugins/accounts/SimplydebridCOM.py b/module/plugins/accounts/SimplydebridCOM.py index faa6091c5..2b14a37c2 100644 --- a/module/plugins/accounts/SimplydebridCOM.py +++ b/module/plugins/accounts/SimplydebridCOM.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- +from time import mktime, strptime + from module.plugins.Account import Account -import re -from time import mktime, strptime class SimplydebridCOM(Account): __name__ = "SimplydebridCOM" @@ -14,20 +14,17 @@ class SimplydebridCOM(Account): 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) + 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")) - } + 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) + 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 index 721dce6ca..b45d289ee 100644 --- a/module/plugins/hooks/SimplydebridCOM.py +++ b/module/plugins/hooks/SimplydebridCOM.py @@ -3,6 +3,7 @@ from module.network.RequestFactory import getURL from module.plugins.internal.MultiHoster import MultiHoster + class SimplydebridCOM(MultiHoster): __name__ = "SimplydebridCOM" __version__ = "0.01" @@ -16,4 +17,4 @@ class SimplydebridCOM(MultiHoster): def getHoster(self): page = getURL("http://simply-debrid.com/api.php?list=1") - return [x.strip() for x in page.rstrip(';').replace("\"","").split(";")] + return [x.strip() for x in page.rstrip(';').replace("\"", "").split(";")] diff --git a/module/plugins/hoster/SimplydebridCOM.py b/module/plugins/hoster/SimplydebridCOM.py index 499c17145..69c5b8af1 100644 --- a/module/plugins/hoster/SimplydebridCOM.py +++ b/module/plugins/hoster/SimplydebridCOM.py @@ -1,12 +1,12 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from module.plugins.Hoster import Hoster -from module.utils import html_unescape from urllib import quote, unquote -from time import sleep import re +from module.plugins.Hoster import Hoster + + class SimplydebridCOM(Hoster): __name__ = "SimplydebridCOM" __version__ = "0.1" @@ -34,7 +34,7 @@ class SimplydebridCOM(Hoster): 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)): + 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 -- cgit v1.2.3 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 (limited to 'module') 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 From b57439b737a749bf40f62662b6c4434331cc79b0 Mon Sep 17 00:00:00 2001 From: Ivo Buff Date: Sun, 21 Jul 2013 12:35:39 +0200 Subject: More link transformation Added all link transformations I got from the support --- module/plugins/hoster/SimplydebridCom.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'module') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 2dcbd0f21..f13b16ae0 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -31,6 +31,15 @@ class SimplydebridCom(Hoster): 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") + new_url = new_url.replace("ul.to", "uploaded.net/file") + new_url = new_url.replace("uploaded.com", "uploaded.net") + new_url = new_url.replace("filerio.com", "filerio.in") + new_url = new_url.replace("lumfile.com", "lumfile.se") + if('fileparadox' in new_url): + new_url = new_url.replace("http://", "https://") + + if re.match(self.__pattern__, new_url): + new_url = new_url 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']) -- cgit v1.2.3 From d61d1d0b0901acc90770cc48613425013efc0a3d Mon Sep 17 00:00:00 2001 From: Ivo Buff Date: Wed, 7 Aug 2013 22:02:26 +0200 Subject: simplydebrid "handle" bad links simplydebrid "handle" bad links --- module/plugins/hoster/SimplydebridCom.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'module') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index f13b16ae0..d13c161e8 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -52,3 +52,8 @@ class SimplydebridCom(Hoster): self.logDebug("Unrestricted URL: " + new_url) self.download(new_url, disposition=True) + + check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": " Date: Mon, 12 Aug 2013 13:34:18 +0200 Subject: simplydebrid: "further improvements" added debuglog output of the link we send to simplydebrid changed retrying time of a bad file (we try it every 2.5 min for an hour) --- module/plugins/hoster/SimplydebridCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index d13c161e8..35cc3fb02 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -41,6 +41,8 @@ class SimplydebridCom(Hoster): if re.match(self.__pattern__, new_url): new_url = new_url + self.logDebug("New URL: %s" % new_url) + 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): @@ -56,4 +58,4 @@ class SimplydebridCom(Hoster): check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": " Date: Mon, 12 Aug 2013 13:39:44 +0200 Subject: Simplydebrid: added new line added new line at the end of the hoster file --- module/plugins/hoster/SimplydebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 35cc3fb02..03396cc27 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -58,4 +58,4 @@ class SimplydebridCom(Hoster): check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": " Date: Tue, 13 Aug 2013 14:33:18 +0200 Subject: Simplydebrid: cosmetics --- module/plugins/hoster/SimplydebridCom.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 03396cc27..67cc39255 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -22,7 +22,7 @@ class SimplydebridCom(Hoster): def process(self, pyfile): if not self.account: - self.logError(_("Please enter your simply-debrid.com account or deactivate this plugin")) + self.logError(_("Please enter your %s account or deactivate this plugin") % "simply-debrid.com") self.fail("No simply-debrid.com account provided") self.logDebug("Old URL: %s" % pyfile.url) @@ -37,12 +37,12 @@ class SimplydebridCom(Hoster): new_url = new_url.replace("lumfile.com", "lumfile.se") if('fileparadox' in new_url): new_url = new_url.replace("http://", "https://") - + if re.match(self.__pattern__, new_url): new_url = new_url self.logDebug("New URL: %s" % new_url) - + 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): -- cgit v1.2.3