From b0b4132e13b3de05a9da2c58df1685c7dcb097d3 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 12 Dec 2014 20:34:42 +0100 Subject: Update plugins after SimpleHoster changes Conflicts: pyload/plugins/addon/SkipRev.py pyload/plugins/hoster/FastshareCz.py pyload/plugins/hoster/FileSharkPl.py pyload/plugins/hoster/FilerNet.py pyload/plugins/hoster/Keep2shareCc.py --- pyload/plugins/hoster/Keep2shareCc.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'pyload/plugins/hoster/Keep2shareCc.py') diff --git a/pyload/plugins/hoster/Keep2shareCc.py b/pyload/plugins/hoster/Keep2shareCc.py index 25d92e273..31867d2d4 100644 --- a/pyload/plugins/hoster/Keep2shareCc.py +++ b/pyload/plugins/hoster/Keep2shareCc.py @@ -11,7 +11,7 @@ from pyload.plugins.internal.SimpleHoster import _isDirectLink, SimpleHoster, cr class Keep2shareCc(SimpleHoster): __name = "Keep2shareCc" __type = "hoster" - __version = "0.16" + __version = "0.17" __pattern = r'https?://(?:www\.)?(keep2share|k2s|keep2s)\.cc/file/(?P\w+)' @@ -23,8 +23,6 @@ class Keep2shareCc(SimpleHoster): URL_REPLACEMENTS = [(__pattern + ".*", "http://k2s.cc/file/\g")] - CONTENT_DISPOSITION = True - NAME_PATTERN = r'File: (?P.+)' SIZE_PATTERN = r'Size: (?P[^<]+)' @@ -87,13 +85,7 @@ class Keep2shareCc(SimpleHoster): if m is None: self.error(_("LINK_FREE_PATTERN not found")) - self.link = self._getDownloadLink(m.group(1)) - - - def handlePremium(self): - super(Keep2shareCc, self).handlePremium() - if self.link: - self.link = self._getDownloadLink(self.link) + self.link = m.group(1) def handleCaptcha(self): @@ -125,11 +117,16 @@ class Keep2shareCc(SimpleHoster): self.fail(_("All captcha attempts failed")) - def _getDownloadLink(self, url): - p = urlparse(self.pyfile.url) + def downloadLink(self, link): + if not link: + return + + p = urlparse(self.pyfile.url) base = "%s://%s" % (p.scheme, p.netloc) - link = _isDirectLink(self, url, self.premium) - return urljoin(base, link) if link else "" + link = _isDirectLink(self, link, self.premium) + + if link: + self.download(urljoin(base, link), disposition=True) getInfo = create_getInfo(Keep2shareCc) -- cgit v1.2.3