From 57300575fa97107d172e0c9909b244c8c8ae6c12 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 20:02:20 +0100 Subject: Extend SimpleHoster in multi-hoster plugins --- module/plugins/hoster/SimplydebridCom.py | 53 +++++++++++++++----------------- 1 file changed, 25 insertions(+), 28 deletions(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 0fe4ae0f8..6f3ecfc42 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -2,10 +2,10 @@ import re -from module.plugins.Hoster import Hoster +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo -class SimplydebridCom(Hoster): +class SimplydebridCom(SimpleHoster): __name__ = "SimplydebridCom" __type__ = "hoster" __version__ = "0.10" @@ -23,42 +23,39 @@ class SimplydebridCom(Hoster): self.chunkLimit = 1 - def process(self, pyfile): - if not self.account: - self.logError(_("Please enter your %s account or deactivate this plugin") % "simply-debrid.com") - self.fail(_("No simply-debrid.com account provided")) + def handleMulti(self): + #fix the links for simply-debrid.com! + self.link = self.pyfile.url + self.link = self.link.replace("clz.to", "cloudzer.net/file") + self.link = self.link.replace("http://share-online", "http://www.share-online") + self.link = self.link.replace("ul.to", "uploaded.net/file") + self.link = self.link.replace("uploaded.com", "uploaded.net") + self.link = self.link.replace("filerio.com", "filerio.in") + self.link = self.link.replace("lumfile.com", "lumfile.se") - self.logDebug("Old URL: %s" % pyfile.url) + if('fileparadox' in self.link): + self.link = self.link.replace("http://", "https://") - #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") - 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 - - 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 re.match(self.__pattern__, self.link): + self.link = self.link + + self.logDebug("New URL: %s" % self.link) + + if not re.match(self.__pattern__, self.link): + page = self.load("http://simply-debrid.com/api.php", get={'dl': self.link}) # +'&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.link = page self.setWait(5) self.wait() - self.logDebug("Unrestricted URL: " + new_url) - self.download(new_url, disposition=True) + def checkFile(self): check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": " Date: Wed, 17 Dec 2014 21:47:39 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (2) --- module/plugins/hoster/SimplydebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 6f3ecfc42..196cdfd4b 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SimplydebridCom(SimpleHoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.10" + __version__ = "0.11" __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*' -- cgit v1.2.3 From 0860e09f5ff16ee3f097f6f9d444f277a38abd72 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 17 Dec 2014 23:03:46 +0100 Subject: Extend SimpleHoster in multi-hoster plugins (3) --- module/plugins/hoster/SimplydebridCom.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 196cdfd4b..1b8ff11b2 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -17,6 +17,9 @@ class SimplydebridCom(SimpleHoster): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] + MULTI_HOSTER = True + + def setup(self): self.resumeDownload = True self.multiDL = True -- cgit v1.2.3 From 4e9c8f7ab1269966a9eac9e1b6363f5458f9f970 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 18 Dec 2014 16:07:21 +0100 Subject: Update checkFile routine in some hoster plugins --- module/plugins/hoster/SimplydebridCom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 1b8ff11b2..8fa756606 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class SimplydebridCom(SimpleHoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.11" + __version__ = "0.12" __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*' @@ -55,6 +55,8 @@ class SimplydebridCom(SimpleHoster): def checkFile(self): + super(SimplydebridCom, self).checkFile() + check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": " Date: Tue, 23 Dec 2014 13:20:53 +0100 Subject: New plugin: MultiHoster --- module/plugins/hoster/SimplydebridCom.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 8fa756606..e17ee41de 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -2,13 +2,13 @@ import re -from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo +from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -class SimplydebridCom(SimpleHoster): +class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.12" + __version__ = "0.13" __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*' @@ -17,9 +17,6 @@ class SimplydebridCom(SimpleHoster): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - MULTI_HOSTER = True - - def setup(self): self.resumeDownload = True self.multiDL = True -- cgit v1.2.3 From a4786e340993bbfc5d2bf971c9bec18863d3dd80 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 23 Dec 2014 19:29:15 +0100 Subject: [MultiHoster] Update --- module/plugins/hoster/SimplydebridCom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index e17ee41de..b4be77031 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -8,7 +8,7 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.13" + __version__ = "0.14" __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*' @@ -23,7 +23,7 @@ class SimplydebridCom(MultiHoster): self.chunkLimit = 1 - def handleMulti(self): + def handlePremium(self): #fix the links for simply-debrid.com! self.link = self.pyfile.url self.link = self.link.replace("clz.to", "cloudzer.net/file") -- cgit v1.2.3 From cdb06469a640c1875229903a2dbdfa8be469b5bc Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 27 Dec 2014 13:52:30 +0100 Subject: Improve a lot of plugin __pattern__ --- module/plugins/hoster/SimplydebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index b4be77031..5e6b47efc 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -10,7 +10,7 @@ class SimplydebridCom(MultiHoster): __type__ = "hoster" __version__ = "0.14" - __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php/*' + __pattern__ = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php' __description__ = """Simply-debrid.com hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From ea58af3c625d90aec6becfd943289e42e4a71a9a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 02:49:26 +0100 Subject: Code cosmetics --- module/plugins/hoster/SimplydebridCom.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 5e6b47efc..8211d40d4 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -17,12 +17,6 @@ class SimplydebridCom(MultiHoster): __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - def setup(self): - self.resumeDownload = True - self.multiDL = True - self.chunkLimit = 1 - - def handlePremium(self): #fix the links for simply-debrid.com! self.link = self.pyfile.url -- cgit v1.2.3 From 7979d0833573a107baae8c45330b8b5874630a76 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 4 Jan 2015 20:26:13 +0100 Subject: Spare code improvements --- module/plugins/hoster/SimplydebridCom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 8211d40d4..0be9bfa12 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -36,7 +36,7 @@ class SimplydebridCom(MultiHoster): self.logDebug("New URL: %s" % self.link) if not re.match(self.__pattern__, self.link): - page = self.load("http://simply-debrid.com/api.php", get={'dl': self.link}) # +'&u='+self.user+'&p='+self.account.getAccountData(self.user)['password']) + page = self.load("http://simply-debrid.com/api.php", get={'dl': self.link}) if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): self.fail(_("Unable to unrestrict link")) self.link = page -- cgit v1.2.3 From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/SimplydebridCom.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 0be9bfa12..a26bc5751 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -8,18 +8,18 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class SimplydebridCom(MultiHoster): __name__ = "SimplydebridCom" __type__ = "hoster" - __version__ = "0.14" + __version__ = "0.15" __pattern__ = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php' - __description__ = """Simply-debrid.com hoster plugin""" + __description__ = """Simply-debrid.com multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("Kagenoshin", "kagenoshin@gmx.ch")] - def handlePremium(self): + def handlePremium(self, pyfile): #fix the links for simply-debrid.com! - self.link = self.pyfile.url + self.link = pyfile.url self.link = self.link.replace("clz.to", "cloudzer.net/file") self.link = self.link.replace("http://share-online", "http://www.share-online") self.link = self.link.replace("ul.to", "uploaded.net/file") @@ -46,12 +46,10 @@ class SimplydebridCom(MultiHoster): def checkFile(self): - super(SimplydebridCom, self).checkFile() - - check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": " Date: Sun, 8 Feb 2015 02:09:45 +0100 Subject: Spare code cosmetics --- module/plugins/hoster/SimplydebridCom.py | 37 +++++++++++++------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'module/plugins/hoster/SimplydebridCom.py') diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index a26bc5751..24811d6aa 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -2,7 +2,7 @@ import re -from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo +from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo, replace_patterns class SimplydebridCom(MultiHoster): @@ -19,35 +19,28 @@ class SimplydebridCom(MultiHoster): def handlePremium(self, pyfile): #fix the links for simply-debrid.com! - self.link = pyfile.url - self.link = self.link.replace("clz.to", "cloudzer.net/file") - self.link = self.link.replace("http://share-online", "http://www.share-online") - self.link = self.link.replace("ul.to", "uploaded.net/file") - self.link = self.link.replace("uploaded.com", "uploaded.net") - self.link = self.link.replace("filerio.com", "filerio.in") - self.link = self.link.replace("lumfile.com", "lumfile.se") - - if('fileparadox' in self.link): + self.link = replace_patterns(pyfile.url, [("clz.to", "cloudzer.net/file") + ("http://share-online", "http://www.share-online") + ("ul.to", "uploaded.net/file") + ("uploaded.com", "uploaded.net") + ("filerio.com", "filerio.in") + ("lumfile.com", "lumfile.se")] + + if 'fileparadox' in self.link: self.link = self.link.replace("http://", "https://") - if re.match(self.__pattern__, self.link): - self.link = self.link + self.html = self.load("http://simply-debrid.com/api.php", get={'dl': self.link}) + if 'tiger Link' in self.html or 'Invalid Link' in self.html or ('API' in self.html and 'ERROR' in self.html): + self.error(_("Unable to unrestrict link")) - self.logDebug("New URL: %s" % self.link) + self.link = self.html - if not re.match(self.__pattern__, self.link): - page = self.load("http://simply-debrid.com/api.php", get={'dl': self.link}) - if 'tiger Link' in page or 'Invalid Link' in page or ('API' in page and 'ERROR' in page): - self.fail(_("Unable to unrestrict link")) - self.link = page - - self.setWait(5) - self.wait() + self.wait(5) def checkFile(self): if self.checkDownload({"error": "No address associated with hostname"}): - self.retry(24, 3 * 60, "Bad file downloaded") + self.retry(24, 3 * 60, _("Bad file downloaded")) return super(SimplydebridCom, self).checkFile() -- cgit v1.2.3