summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster/WebshareCz.py
diff options
context:
space:
mode:
authorGravatar GammaC0de <GammaC0de@users.noreply.github.com> 2015-05-29 23:33:10 +0200
committerGravatar GammaC0de <GammaC0de@users.noreply.github.com> 2015-05-29 23:33:10 +0200
commit844dfd92f590e531ca2f7fd86305fcbc13a03721 (patch)
tree5303bd07749b362dab071ada6197fe37dda85b27 /module/plugins/hoster/WebshareCz.py
parent[BitshareCom] Code cosmetics (diff)
parent[SimpleHoster] Fix DB error (diff)
downloadpyload-844dfd92f590e531ca2f7fd86305fcbc13a03721.tar.xz
Merge pull request #1 from pyload/stable
sync stable
Diffstat (limited to 'module/plugins/hoster/WebshareCz.py')
-rw-r--r--module/plugins/hoster/WebshareCz.py20
1 files changed, 9 insertions, 11 deletions
diff --git a/module/plugins/hoster/WebshareCz.py b/module/plugins/hoster/WebshareCz.py
index a08341ff3..ae670c8d4 100644
--- a/module/plugins/hoster/WebshareCz.py
+++ b/module/plugins/hoster/WebshareCz.py
@@ -9,9 +9,10 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class WebshareCz(SimpleHoster):
__name__ = "WebshareCz"
__type__ = "hoster"
- __version__ = "0.14"
+ __version__ = "0.16"
__pattern__ = r'https?://(?:www\.)?webshare\.cz/(?:#/)?file/(?P<ID>\w+)'
+ __config__ = [("use_premium", "bool", "Use premium account if available", True)]
__description__ = """WebShare.cz hoster plugin"""
__license__ = "GPLv3"
@@ -21,7 +22,7 @@ class WebshareCz(SimpleHoster):
@classmethod
def getInfo(cls, url="", html=""):
- info = super(WebshareCz, self).getInfo(url, html)
+ info = super(WebshareCz, cls).getInfo(url, html)
if url:
info['pattern'] = re.match(cls.__pattern__, url).groupdict()
@@ -40,25 +41,22 @@ class WebshareCz(SimpleHoster):
return info
- def handleFree(self):
- fid = re.match(self.__pattern__, self.pyfile.url).group('ID')
+ def handleFree(self, pyfile):
wst = self.account.infos['wst'] if self.account and 'wst' in self.account.infos else ""
api_data = getURL('https://webshare.cz/api/file_link/',
- post={'ident': fid, 'wst': wst},
+ post={'ident': self.info['pattern']['ID'], 'wst': wst},
decode=True)
self.logDebug("API data: " + api_data)
m = re.search('<link>(.+)</link>', api_data)
- if m is None:
- self.error(_("Unable to detect direct link"))
+ if m:
+ self.link = m.group(1)
- self.link = m.group(1)
-
- def handlePremium(self):
- return self.handleFree()
+ def handlePremium(self, pyfile):
+ return self.handleFree(pyfile)
getInfo = create_getInfo(WebshareCz)