diff options
| author | 2015-02-16 21:59:10 +0100 | |
|---|---|---|
| committer | 2015-02-16 21:59:10 +0100 | |
| commit | 8e7d14bae4d3c836f029a1235eb227380acc3f75 (patch) | |
| tree | ebd0679642cccb994e70a89a106b394189cb28bc /pyload/plugin/hoster/SimplydebridCom.py | |
| parent | Merge branch 'stable' into 0.4.10 (diff) | |
| download | pyload-8e7d14bae4d3c836f029a1235eb227380acc3f75.tar.xz | |
Fix plugins to work on 0.4.10
Diffstat (limited to 'pyload/plugin/hoster/SimplydebridCom.py')
| -rw-r--r-- | pyload/plugin/hoster/SimplydebridCom.py | 45 | 
1 files changed, 45 insertions, 0 deletions
| diff --git a/pyload/plugin/hoster/SimplydebridCom.py b/pyload/plugin/hoster/SimplydebridCom.py new file mode 100644 index 000000000..4b740ff20 --- /dev/null +++ b/pyload/plugin/hoster/SimplydebridCom.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugin.internal.MultiHoster import MultiHoster, replace_patterns + + +class SimplydebridCom(MultiHoster): +    __name__    = "SimplydebridCom" +    __type__    = "hoster" +    __version__ = "0.15" + +    __pattern__ = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/sd\.php' + +    __description__ = """Simply-debrid.com multi-hoster plugin""" +    __license__     = "GPLv3" +    __authors__     = [("Kagenoshin", "kagenoshin@gmx.ch")] + + +    def handlePremium(self, pyfile): +        #fix the links for simply-debrid.com! +        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://") + +        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.link = self.html + +        self.wait(5) + + +    def checkFile(self): +        if self.checkDownload({"error": "No address associated with hostname"}): +            self.retry(24, 3 * 60, _("Bad file downloaded")) + +        return super(SimplydebridCom, self).checkFile() | 
