diff options
Diffstat (limited to 'module/plugins/hoster/DebridItaliaCom.py')
-rw-r--r-- | module/plugins/hoster/DebridItaliaCom.py | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/module/plugins/hoster/DebridItaliaCom.py b/module/plugins/hoster/DebridItaliaCom.py index c28cdd89a..8cda56c0c 100644 --- a/module/plugins/hoster/DebridItaliaCom.py +++ b/module/plugins/hoster/DebridItaliaCom.py @@ -2,52 +2,42 @@ import re -from pyload.plugin.Hoster import Hoster -from pyload.plugin.internal.SimpleHoster import replace_patterns +from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo -class DebridItaliaCom(Hoster): +class DebridItaliaCom(MultiHoster): __name__ = "DebridItaliaCom" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.17" - __pattern__ = r'http://s\d+\.debriditalia\.com/dl/\d+' + __pattern__ = r'https?://(?:www\.|s\d+\.)?debriditalia\.com/dl/\d+' - __description__ = """Debriditalia.com hoster plugin""" + __description__ = """Debriditalia.com multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it"), ("Walter Purcaro", "vuolter@gmail.com")] - URL_REPLACEMENTS = [(r'(/dl/\d+)$', '\1/')] + URL_REPLACEMENTS = [("https://", "http://")] - 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")) + def handlePremium(self, pyfile): + self.html = self.load("http://www.debriditalia.com/api.php", + get={'generate': "on", 'link': pyfile.url, 'p': self.getPassword()}) + if "ERROR:" not in self.html: + self.link = self.html.strip() 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.info['error'] = re.search(r'ERROR:(.*)', self.html).group(1).strip() - self.download(link, disposition=True) + self.html = self.load("http://debriditalia.com/linkgen2.php", + post={'xjxfun' : "convertiLink", + 'xjxargs[]': "S<![CDATA[%s]]>" % pyfile.url, + 'xjxargs[]': "S%s" % self.getPassword()}) + try: + self.link = re.search(r'<a href="(.+?)"', self.html).group(1) + except AttributeError: + pass - check = self.checkDownload({'empty': re.compile(r'^$')}) - if check == "empty": - self.retry(5, 2 * 60, "Empty file downloaded") +getInfo = create_getInfo(DebridItaliaCom) |