diff options
author | synweap15 <shamdog+github@gmail.com> | 2014-12-30 20:21:23 +0100 |
---|---|---|
committer | synweap15 <shamdog+github@gmail.com> | 2014-12-30 20:21:23 +0100 |
commit | ac9ba34bd5e629ddfbe67dec88ff2e0653e80356 (patch) | |
tree | f77bc281bd083145b19e82bf0e5ff34f5cd6f01a /module/plugins/hoster/SimplydebridCom.py | |
parent | [Oboom] new hoster and account (diff) | |
parent | Update some MultiHoster __pattern__ (diff) | |
download | pyload-ac9ba34bd5e629ddfbe67dec88ff2e0653e80356.tar.xz |
Merge pull request #1 from pyload/stable
Merge
Diffstat (limited to 'module/plugins/hoster/SimplydebridCom.py')
-rw-r--r-- | module/plugins/hoster/SimplydebridCom.py | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/module/plugins/hoster/SimplydebridCom.py b/module/plugins/hoster/SimplydebridCom.py index 2aab12e04..5e6b47efc 100644 --- a/module/plugins/hoster/SimplydebridCom.py +++ b/module/plugins/hoster/SimplydebridCom.py @@ -2,58 +2,62 @@ import re -from module.plugins.Hoster import Hoster +from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -class SimplydebridCom(Hoster): - __name__ = "SimplydebridCom" - __version__ = "0.1" - __type__ = "hoster" - __pattern__ = r'http://(?:www\.)?\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd.php/*' +class SimplydebridCom(MultiHoster): + __name__ = "SimplydebridCom" + __type__ = "hoster" + __version__ = "0.14" + + __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" + __license__ = "GPLv3" + __authors__ = [("Kagenoshin", "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 %s account or deactivate this plugin") % "simply-debrid.com") - self.fail("No simply-debrid.com account provided") + def setup(self): + self.resumeDownload = True + self.multiDL = True + self.chunkLimit = 1 - self.logDebug("Old URL: %s" % pyfile.url) + def handlePremium(self): #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']) + 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") + + if('fileparadox' in self.link): + self.link = self.link.replace("http://", "https://") + + 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.fail(_("Unable to unrestrict link")) + self.link = page self.setWait(5) self.wait() - self.logDebug("Unrestricted URL: " + new_url) - self.download(new_url, disposition=True) + + def checkFile(self): + super(SimplydebridCom, self).checkFile() check = self.checkDownload({"bad1": "No address associated with hostname", "bad2": "<html"}) if check == "bad1" or check == "bad2": self.retry(24, 3 * 60, "Bad file downloaded") + + +getInfo = create_getInfo(SimplydebridCom) |