diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
commit | acc46fc3497a66a427b795b4a22c6e71d69185a1 (patch) | |
tree | 2d315b838a76435fc456b972c99c28d1732b2f70 /pyload/plugin/hoster/DebridItaliaCom.py | |
parent | Code fixes (diff) | |
download | pyload-acc46fc3497a66a427b795b4a22c6e71d69185a1.tar.xz |
Update
Diffstat (limited to 'pyload/plugin/hoster/DebridItaliaCom.py')
-rw-r--r-- | pyload/plugin/hoster/DebridItaliaCom.py | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/pyload/plugin/hoster/DebridItaliaCom.py b/pyload/plugin/hoster/DebridItaliaCom.py new file mode 100644 index 000000000..134309408 --- /dev/null +++ b/pyload/plugin/hoster/DebridItaliaCom.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- + +import re + +from pyload.plugin.Hoster import Hoster +from pyload.plugin.internal.SimpleHoster import replace_patterns + + +class DebridItaliaCom(Hoster): + __name = "DebridItaliaCom" + __type = "hoster" + __version = "0.07" + + __pattern = r'http://s\d+\.debriditalia\.com/dl/\d+' + + __description = """Debriditalia.com hoster plugin""" + __license = "GPLv3" + __authors = [("stickell", "l.stickell@yahoo.it"), + ("Walter Purcaro", "vuolter@gmail.com")] + + + URL_REPLACEMENTS = [(r'(/dl/\d+)$', '\1/')] + + + def setup(self): + self.chunkLimit = -1 + self.resumeDownload = True + + + def process(self, pyfile): + pyfile.url = replace_patterns(pyfile.url, cls.URL_REPLACEMENTS) + + if re.match(self.__pattern, pyfile.url): + link = pyfile.url + + elif not self.account: + self.logError(_("Please enter your %s account or deactivate this plugin") % "DebridItalia") + self.fail(_("No DebridItalia account provided")) + + else: + html = self.load("http://www.debriditalia.com/api.php", get={'generate': "", 'link': pyfile.url}) + + if "ERROR" in html: + self.fail(re.search(r'ERROR:(.*)', html).strip()) + + link = html.strip() + + self.download(link, disposition=True) + + check = self.checkDownload({'empty': re.compile(r'^$')}) + + if check == "empty": + self.retry(5, 2 * 60, "Empty file downloaded") |