diff options
author | zoidberg10 <zoidberg@mujmail.cz> | 2012-10-30 23:57:46 +0100 |
---|---|---|
committer | zoidberg10 <zoidberg@mujmail.cz> | 2012-10-30 23:57:46 +0100 |
commit | 10882cdcf116758d7cc35a72c7432a1bf4cdd15f (patch) | |
tree | 2ce46097c96be136c2e5215e60f131e2b3416ff8 /module | |
parent | youtube - add 3D formats, update playlist crypter (diff) | |
download | pyload-10882cdcf116758d7cc35a72c7432a1bf4cdd15f.tar.xz |
update bezvadata,fastshare,dataport
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hoster/BezvadataCz.py | 52 | ||||
-rw-r--r-- | module/plugins/hoster/DataportCz.py | 7 | ||||
-rw-r--r-- | module/plugins/hoster/FastshareCz.py | 23 |
3 files changed, 63 insertions, 19 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py index 680bbc173..37ef145b2 100644 --- a/module/plugins/hoster/BezvadataCz.py +++ b/module/plugins/hoster/BezvadataCz.py @@ -23,7 +23,7 @@ class BezvadataCz(SimpleHoster): __name__ = "BezvadataCz" __type__ = "hoster" __pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*" - __version__ = "0.22" + __version__ = "0.23" __description__ = """BezvaData.cz""" __author_name__ = ("zoidberg") __author_mail__ = ("zoidberg@mujmail.cz") @@ -31,15 +31,51 @@ class BezvadataCz(SimpleHoster): FILE_NAME_PATTERN = r'<p><b>Soubor: (?P<N>[^<]+)</b></p>' FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> (?P<S>[^<]+)</li>' FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>' - DOWNLOAD_FORM_PATTERN = r'<form class="download" action="([^"]+)" method="post" id="frm-stahnoutForm">' + + def setup(self): + self.multiDL = self.resumeDownload = True def handleFree(self): - found = re.search(self.DOWNLOAD_FORM_PATTERN, self.html) - if found is None: self.parseError("Download form") - url = "http://bezvadata.cz" + found.group(1) - self.logDebug("Download form: %s" % url) - - self.download(url, post = {"stahnoutSoubor": "St%C3%A1hnout"}, cookies = True) + #download button + found = re.search(r'<a class="stahnoutSoubor".*?href="(.*?)"', self.html) + if not found: self.parseError("page1 URL") + url = "http://bezvadata.cz%s" % found.group(1) + + #captcha form + self.html = self.load(url) + if 'images/button-download-disable.png' in self.html: + self.longWait(300, 24) #parallel dl limit + action, inputs = self.parseHtmlForm('frm-stahnoutFreeForm') + if not inputs: self.parseError("FreeForm") + found = re.search(r'<img src="data:image/png;base64,(.*?)"', self.html) + if not found: self.parseError("captcha img") + + #captcha image is contained in html page as base64encoded data, not url + self.load, proper_load = self.loadcaptcha, self.load + try: + inputs['captcha'] = self.decryptCaptcha(found.group(1), imgtype='png') + finally: + self.load = proper_load + + #download url + self.html = self.load("http://bezvadata.cz%s" % action, post=inputs) + if '<div class="infobox error"' in self.html: + self.tempOffline() + found = re.search(r'<a class="stahnoutSoubor2" href="(.*?)">', self.html) + if not found: self.parseError("page2 URL") + url = "http://bezvadata.cz%s" % found.group(1) + self.logDebug("DL URL %s" % url) + + #countdown + found = re.search(r'id="countdown">(\d\d):(\d\d)<', self.html) + wait_time = (int(found.group(1)) * 60 + int(found.group(2)) + 1) if found else 120 + self.setWait(wait_time, False) + self.wait() + + self.download(url) + + def loadcaptcha(self, data, *args, **kwargs): + return data.decode("base64") getInfo = create_getInfo(BezvadataCz)
\ No newline at end of file diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py index cef115941..952824ec9 100644 --- a/module/plugins/hoster/DataportCz.py +++ b/module/plugins/hoster/DataportCz.py @@ -23,14 +23,15 @@ from pycurl import FOLLOWLOCATION class DataportCz(SimpleHoster): __name__ = "DataportCz" __type__ = "hoster" - __pattern__ = r"http://.*dataport.cz/file/.*" - __version__ = "0.35" + __pattern__ = r"http://.*dataport.cz/file/(\d+).*" + __version__ = "0.36" __description__ = """Dataport.cz plugin - free only""" __author_name__ = ("zoidberg") FILE_NAME_PATTERN = r'<span itemprop="name">(?P<N>[^<]+)</span>' FILE_SIZE_PATTERN = r'<td class="fil">Velikost</td>\s*<td>(?P<S>[^<]+)</td>' FILE_OFFLINE_PATTERN = r'<h2>Soubor nebyl nalezen</h2>' + FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] CAPTCHA_URL_PATTERN = r'<section id="captcha_bg">\s*<img src="(.*?)"' FREE_SLOTS_PATTERN = ur'Počet volných slotů: <span class="darkblue">(\d+)</span><br />' @@ -49,7 +50,7 @@ class DataportCz(SimpleHoster): else: raise PluginParseError('captcha') - self.html = self.download("http://dataport.cz%s" % action, post = inputs) + self.html = self.download("http://www.dataport.cz%s" % action, post = inputs) check = self.checkDownload({"captcha": 'alert("\u0160patn\u011b opsan\u00fd k\u00f3d z obr\u00e1zu");', "slot": 'alert("Je n\u00e1m l\u00edto, ale moment\u00e1ln\u011b nejsou'}) diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index d71684166..cc0b18c96 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -23,14 +23,14 @@ class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" __pattern__ = r"http://(?:\w*\.)?fastshare.cz/\d+/.+" - __version__ = "0.13" + __version__ = "0.14" __description__ = """FastShare.cz""" __author_name__ = ("zoidberg") - FILE_NAME_PATTERN = r'<h3><b><span style=color:black;>(?P<N>[^<]+)</b></h3>' + FILE_NAME_PATTERN = r'<h[23]><b><span style=color:black;>(?P<N>[^<]+)</b></h[23]>' FILE_SIZE_PATTERN = r'<tr><td>Velikost: </td><td style=font-weight:bold>(?P<S>[^<]+)</td></tr>' - FILE_OFFLINE_PATTERN = r'<div id="content">\s*<div style=background-color:white' - SH_HTML_ENCODING = 'cp1250' + FILE_OFFLINE_PATTERN = ur'<td align=center>Tento soubor byl smazán' + SH_COOKIES = [("fastshare.cz","lang","cs")] FILE_URL_REPLACEMENTS = [('#.*','')] FREE_URL_PATTERN = ur'<form method=post action=(/free/.*?)><b>Stáhnout FREE.*?<img src="([^"]*)">' @@ -38,31 +38,38 @@ class FastshareCz(SimpleHoster): NOT_ENOUGH_CREDIC_PATTERN = "Nem.te dostate.n. kredit pro sta.en. tohoto souboru" def handleFree(self): + if u">100% FREE slotů je plných.<" in self.html: + self.setWait(60, False) + self.wait() + self.retry(120, "No free slots") + found = re.search(self.FREE_URL_PATTERN, self.html) if not found: self.parseError("Free URL") action, captcha_src = found.groups() captcha = self.decryptCaptcha("http://www.fastshare.cz/" + captcha_src) self.download("http://www.fastshare.cz/" + action, post = {"code": captcha, "submit": u"stáhnout"}) - check = self.checkDownload({"paralell_dl": "<script>alert('Pres FREE muzete stahovat jen jeden soubor najednou.')"}) + check = self.checkDownload({ + "paralell_dl": "<title>FastShare.cz</title>|<script>alert\('Pres FREE muzete stahovat jen jeden soubor najednou.'\)" + }) self.logDebug(self.req.lastEffectiveURL, self.req.lastURL, self.req.code) if check == "paralell_dl": self.setWait(600, True) self.wait() - self.retry() + self.retry(6, "Paralell download") def handlePremium(self): if self.NOT_ENOUGH_CREDIC_PATTERN in self.html: self.logWarning('Not enough traffic left') self.resetAccount() - + found = re.search(self.PREMIUM_URL_PATTERN, self.html) if not found: self.parseError("Premium URL") url = found.group(1) self.logDebug("PREMIUM URL: %s" % url) self.download(url) - + check = self.checkDownload({"credit": re.compile(self.NOT_ENOUGH_CREDIC_PATTERN)}) if check == "credit": self.resetAccount() |