summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/BezvadataCz.py
diff options
context:
space:
mode:
authorGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-11-13 00:47:02 +0100
committerGravatar zoidberg10 <zoidberg@mujmail.cz> 2011-11-13 00:47:02 +0100
commite3a62f8a2e9dcb4212f6fa8e1a94f832ad66d35a (patch)
tree121b107759d11e11890267355119ecf47e3e7fba /module/plugins/hoster/BezvadataCz.py
parentMerged in nick_de/pyload (pull request #5) (diff)
downloadpyload-e3a62f8a2e9dcb4212f6fa8e1a94f832ad66d35a.tar.xz
Move getFileInfo to SimpleHoster.py; update Mediafire
Diffstat (limited to 'module/plugins/hoster/BezvadataCz.py')
-rw-r--r--module/plugins/hoster/BezvadataCz.py65
1 files changed, 26 insertions, 39 deletions
diff --git a/module/plugins/hoster/BezvadataCz.py b/module/plugins/hoster/BezvadataCz.py
index 71622885a..4c198d95f 100644
--- a/module/plugins/hoster/BezvadataCz.py
+++ b/module/plugins/hoster/BezvadataCz.py
@@ -17,50 +17,37 @@
"""
import re
-from module.plugins.Hoster import Hoster
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
+from module.network.RequestFactory import getURL
-class BezvadataCz(Hoster):
+def getInfo(urls):
+ result = []
+
+ for url in urls:
+ file_info = parseFileInfo(BezvadataCz, url, getURL(url, decode=True))
+ result.append(file_info)
+
+ yield result
+
+class BezvadataCz(SimpleHoster):
__name__ = "BezvadataCz"
__type__ = "hoster"
__pattern__ = r"http://(\w*\.)*bezvadata.cz/stahnout/.*"
- __version__ = "0.2"
+ __version__ = "0.21"
__description__ = """BezvaData.cz"""
__author_name__ = ("zoidberg")
__author_mail__ = ("zoidberg@mujmail.cz")
- ID_PATTERN = r'<input type="hidden" name="souborId" value="([^"]+)">'
- HASH_PATTERN = r'<input type="hidden" name="souborHash" value="([^"]+)">'
- FILENAME_PATTERN = r'<title>BezvaData \| Stáhnout soubor ([^<]+)</title>'
- OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>'
-
- def setup(self):
- self.multiDL = False
-
- def process(self, pyfile):
- self.html = self.load(pyfile.url, decode = True)
-
- if re.search(self.OFFLINE_PATTERN, self.html) is not None:
- self.offline()
-
- found = re.search(self.FILENAME_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (FILENAME)")
- pyfile.name = found.group(1)
-
- found = re.search(self.ID_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (ID)")
- souborId = found.group(1)
-
- found = re.search(self.HASH_PATTERN, self.html)
- if found is None:
- self.fail("Parse error (HASH)")
- souborHash = found.group(1)
-
- self.logDebug("URL:"+pyfile.url+" ID:"+souborId+" HASH:"+souborHash)
-
- self.download(pyfile.url, post = {
- "souborId": souborId,
- "souborHash": souborHash,
- "_send": 'STAHNOUT SOUBOR'
- }) \ No newline at end of file
+ FILE_NAME_PATTERN = r'<p><b>Soubor: ([^<]+)</b></p>'
+ FILE_SIZE_PATTERN = r'<li><strong>Velikost:</strong> ([0-9.]+) ([kKMG]i?B)</li>'
+ FILE_OFFLINE_PATTERN = r'<title>BezvaData \| Soubor nenalezen</title>'
+ DOWNLOAD_FORM_PATTERN = r'<form class="download" action="([^"]+)" method="post" id="frm-stahnoutForm">'
+
+ 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)
+ \ No newline at end of file