diff options
Diffstat (limited to 'pyload/plugins/hoster/DataportCz.py')
-rw-r--r-- | pyload/plugins/hoster/DataportCz.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/pyload/plugins/hoster/DataportCz.py b/pyload/plugins/hoster/DataportCz.py index be3cb1498..174bd04af 100644 --- a/pyload/plugins/hoster/DataportCz.py +++ b/pyload/plugins/hoster/DataportCz.py @@ -4,46 +4,47 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class DataportCz(SimpleHoster): - __name__ = "DataportCz" - __type__ = "hoster" - __version__ = "0.37" + __name__ = "DataportCz" + __type__ = "hoster" + __version__ = "0.39" - __pattern__ = r'http://(?:www\.)?dataport.cz/file/(.*)' + __pattern__ = r'http://(?:www\.)?dataport\.cz/file/(.*)' __description__ = """Dataport.cz hoster plugin""" - __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] + __license__ = "GPLv3" + __authors__ = [("zoidberg", "zoidberg@mujmail.cz")] - FILE_NAME_PATTERN = r'<span itemprop="name">(?P<N>[^<]+)</span>' - FILE_SIZE_PATTERN = r'<td class="fil">Velikost</td>\s*<td>(?P<S>[^<]+)</td>' + NAME_PATTERN = r'<span itemprop="name">(?P<N>[^<]+)</span>' + SIZE_PATTERN = r'<td class="fil">Velikost</td>\s*<td>(?P<S>[^<]+)</td>' OFFLINE_PATTERN = r'<h2>Soubor nebyl nalezen</h2>' - FILE_URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] + URL_REPLACEMENTS = [(__pattern__, r'http://www.dataport.cz/file/\1')] - CAPTCHA_URL_PATTERN = r'<section id="captcha_bg">\s*<img src="(.*?)"' + CAPTCHA_PATTERN = r'<section id="captcha_bg">\s*<img src="(.*?)"' FREE_SLOTS_PATTERN = ur'Počet volných slotů: <span class="darkblue">(\d+)</span><br />' def handleFree(self): captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"} - for _ in xrange(60): + for _i in xrange(60): action, inputs = self.parseHtmlForm('free_download_form') self.logDebug(action, inputs) if not action or not inputs: - self.parseError('free_download_form') + self.error(_("free_download_form")) if "captchaId" in inputs and inputs['captchaId'] in captchas: inputs['captchaCode'] = captchas[inputs['captchaId']] else: - self.parseError('captcha') + self.error(_("captcha")) 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'}) if check == "captcha": - self.parseError('invalid captcha') + self.error(_("invalid captcha")) elif check == "slot": self.logDebug("No free slots - wait 60s and retry") self.wait(60, False) @@ -53,4 +54,4 @@ class DataportCz(SimpleHoster): break -create_getInfo(DataportCz) +getInfo = create_getInfo(DataportCz) |