summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/DataportCz.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hoster/DataportCz.py')
-rw-r--r--module/plugins/hoster/DataportCz.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/module/plugins/hoster/DataportCz.py b/module/plugins/hoster/DataportCz.py
index 3dc581bf1..1e24388d7 100644
--- a/module/plugins/hoster/DataportCz.py
+++ b/module/plugins/hoster/DataportCz.py
@@ -16,10 +16,9 @@
@author: zoidberg
"""
-import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, PluginParseError
-from pycurl import FOLLOWLOCATION
-
+
+
class DataportCz(SimpleHoster):
__name__ = "DataportCz"
__type__ = "hoster"
@@ -32,26 +31,26 @@ class DataportCz(SimpleHoster):
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="(.*?)"'
+
+ 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 />'
- def handleFree(self):
+ def handleFree(self):
captchas = {"1": "jkeG", "2": "hMJQ", "3": "vmEK", "4": "ePQM", "5": "blBd"}
-
+
for i in range(60):
action, inputs = self.parseHtmlForm('free_download_form')
self.logDebug(action, inputs)
if not action or not inputs:
raise PluginParseError('free_download_form')
-
+
if "captchaId" in inputs and inputs["captchaId"] in captchas:
- inputs['captchaCode'] = captchas[inputs["captchaId"]]
+ inputs['captchaCode'] = captchas[inputs["captchaId"]]
else:
raise PluginParseError('captcha')
-
- self.html = self.download("http://www.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'})
if check == "captcha":
@@ -60,9 +59,10 @@ class DataportCz(SimpleHoster):
self.logDebug("No free slots - wait 60s and retry")
self.setWait(60, False)
self.wait()
- self.html = self.load(self.pyfile.url, decode = True)
+ self.html = self.load(self.pyfile.url, decode=True)
continue
else:
break
-
+
+
create_getInfo(DataportCz) \ No newline at end of file