summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/FlyshareCz.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/FlyshareCz.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/FlyshareCz.py')
-rw-r--r--module/plugins/hoster/FlyshareCz.py32
1 files changed, 10 insertions, 22 deletions
diff --git a/module/plugins/hoster/FlyshareCz.py b/module/plugins/hoster/FlyshareCz.py
index eb07f3d9e..fc7e9f13b 100644
--- a/module/plugins/hoster/FlyshareCz.py
+++ b/module/plugins/hoster/FlyshareCz.py
@@ -17,31 +17,23 @@
"""
import re
-from module.plugins.Hoster import Hoster
+from module.plugins.internal.SimpleHoster import SimpleHoster, parseFileInfo
from module.network.RequestFactory import getURL
def getInfo(urls):
result = []
for url in urls:
- html = getURL(url, decode=True)
- if re.search(FlyshareCz.FILE_OFFLINE_PATTERN, html):
- # File offline
- result.append((url, 0, 1, url))
- else:
- # Get file info
- found = re.search(FlyshareCz.FILE_NAME_PATTERN, html)
- if found is not None:
- name = found.group(1)
- result.append((name, 0, 2, url))
+ file_info = parseFileInfo(FlyshareCz, url, getURL(url, decode=True))
+ result.append(file_info)
+
yield result
-
-class FlyshareCz(Hoster):
+class FlyshareCz(SimpleHoster):
__name__ = "FlyshareCz"
__type__ = "hoster"
__pattern__ = r"http://.*flyshare.cz/stahni/.*"
- __version__ = "0.3"
+ __version__ = "0.31"
__description__ = """flyshare.cz"""
__author_name__ = ("zoidberg")
@@ -49,9 +41,6 @@ class FlyshareCz(Hoster):
ERR_PATTERN = r'<p class="errorreport_error">Chyba: ([^<]+)</p>'
FILE_OFFLINE_PATTERN = r'<p class="errorreport_error">Chyba: File is not available on the server</p>'
- def setup(self):
- self.multiDL = False
-
def process(self, pyfile):
self.html = self.load(pyfile.url, decode=True)
@@ -65,12 +54,11 @@ class FlyshareCz(Hoster):
else:
self.fail(err_dsc)
- found = re.search(self.FILE_NAME_PATTERN, self.html)
- if found is None:
- self.fail("Parse error")
- pyfile.name = found.group(1)
+ self.getFileInfo()
+ self.handleFree()
- self.download(pyfile.url, post={
+ def handleFree(self):
+ self.download(self.pyfile.url, post={
"wmod_command": "wmod_fileshare3:startDownload",
"method": "free"
})