summaryrefslogtreecommitdiffstats
path: root/pyload/plugins/hoster/QuickshareCz.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugins/hoster/QuickshareCz.py')
-rw-r--r--pyload/plugins/hoster/QuickshareCz.py35
1 files changed, 19 insertions, 16 deletions
diff --git a/pyload/plugins/hoster/QuickshareCz.py b/pyload/plugins/hoster/QuickshareCz.py
index 4e42c7c85..5203f90c7 100644
--- a/pyload/plugins/hoster/QuickshareCz.py
+++ b/pyload/plugins/hoster/QuickshareCz.py
@@ -8,19 +8,20 @@ from pyload.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class QuickshareCz(SimpleHoster):
- __name__ = "QuickshareCz"
- __type__ = "hoster"
- __version__ = "0.54"
+ __name__ = "QuickshareCz"
+ __type__ = "hoster"
+ __version__ = "0.55"
- __pattern__ = r'http://(?:[^/]*\.)?quickshare.cz/stahnout-soubor/.*'
+ __pattern__ = r'http://(?:[^/]*\.)?quickshare\.cz/stahnout-soubor/.*'
__description__ = """Quickshare.cz hoster plugin"""
- __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
+ __license__ = "GPLv3"
+ __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
- FILE_NAME_PATTERN = r'<th width="145px">Název:</th>\s*<td style="word-wrap:break-word;">(?P<N>[^<]+)</td>'
- FILE_SIZE_PATTERN = r'<th>Velikost:</th>\s*<td>(?P<S>[0-9.]+) (?P<U>[kKMG])i?B</td>'
- OFFLINE_PATTERN = r'<script type="text/javascript">location.href=\'/chyba\';</script>'
+ NAME_PATTERN = r'<th width="145px">Název:</th>\s*<td style="word-wrap:break-word;">(?P<N>[^<]+)</td>'
+ SIZE_PATTERN = r'<th>Velikost:</th>\s*<td>(?P<S>[\d.,]+) (?P<U>[\w^_]+)</td>'
+ OFFLINE_PATTERN = r'<script type="text/javascript">location\.href=\'/chyba\';</script>'
def process(self, pyfile):
@@ -28,7 +29,7 @@ class QuickshareCz(SimpleHoster):
self.getFileInfo()
# parse js variables
- self.jsvars = dict((x, y.strip("'")) for x, y in re.findall(r"var (\w+) = ([0-9.]+|'[^']*')", self.html))
+ self.jsvars = dict((x, y.strip("'")) for x, y in re.findall(r"var (\w+) = ([\d.]+|'[^']*')", self.html))
self.logDebug(self.jsvars)
pyfile.name = self.jsvars['ID3']
@@ -36,11 +37,11 @@ class QuickshareCz(SimpleHoster):
if self.premium:
if 'UU_prihlasen' in self.jsvars:
if self.jsvars['UU_prihlasen'] == '0':
- self.logWarning("User not logged in")
+ self.logWarning(_("User not logged in"))
self.relogin(self.user)
self.retry()
elif float(self.jsvars['UU_kredit']) < float(self.jsvars['kredit_odecet']):
- self.logWarning("Not enough credit left")
+ self.logWarning(_("Not enough credit left"))
self.premium = False
if self.premium:
@@ -50,7 +51,8 @@ class QuickshareCz(SimpleHoster):
check = self.checkDownload({"err": re.compile(r"\AChyba!")}, max_size=100)
if check == "err":
- self.fail("File not m or plugin defect")
+ self.fail(_("File not m or plugin defect"))
+
def handleFree(self):
# get download url
@@ -63,10 +65,10 @@ class QuickshareCz(SimpleHoster):
self.header = self.req.http.header
self.req.http.c.setopt(FOLLOWLOCATION, 1)
- m = re.search("Location\s*:\s*(.*)", self.header, re.I)
+ m = re.search(r'Location\s*:\s*(.+)', self.header, re.I)
if m is None:
- self.fail('File not found')
- download_url = m.group(1)
+ self.fail(_("File not found"))
+ download_url = m.group(1).rstrip() #@TODO: Remove .rstrip() in 0.4.10
self.logDebug("FREE URL2:" + download_url)
# check errors
@@ -77,11 +79,12 @@ class QuickshareCz(SimpleHoster):
elif m.group(1) == '2':
self.retry(60, 60, "No free slots available")
else:
- self.fail('Error %d' % m.group(1))
+ self.fail(_("Error %d") % m.group(1))
# download file
self.download(download_url)
+
def handlePremium(self):
download_url = '%s/download_premium.php' % self.jsvars['server']
data = dict((x, self.jsvars[x]) for x in self.jsvars if x in ("ID1", "ID2", "ID4", "ID5"))