diff options
Diffstat (limited to 'module/plugins')
-rw-r--r-- | module/plugins/hooks/SkipRev.py | 8 | ||||
-rw-r--r-- | module/plugins/hoster/FastshareCz.py | 5 | ||||
-rw-r--r-- | module/plugins/hoster/FileSharkPl.py | 4 | ||||
-rw-r--r-- | module/plugins/hoster/FilerNet.py | 15 | ||||
-rw-r--r-- | module/plugins/hoster/Keep2shareCc.py | 25 |
5 files changed, 25 insertions, 32 deletions
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 609bb4197..107740a3d 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -10,7 +10,7 @@ from module.plugins.Plugin import SkipDownload class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.14" + __version__ = "0.15" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -37,10 +37,10 @@ class SkipRev(Hook): if hasattr(plugin, "info") and 'name' in plugin.info and plugin.info['name']: name = plugin.info['name'] - elif hasattr(plugin, "parseInfo"): - name = next(plugin.parseInfo([url]))['name'] + elif hasattr(plugin, "parseInfos"): + name = next(plugin.parseInfos([url]))['name'] - elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfo was not found, getInfo should be missing too + elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfos was not found, getInfo should be missing too name = plugin.getInfo(url)['name'] else: diff --git a/module/plugins/hoster/FastshareCz.py b/module/plugins/hoster/FastshareCz.py index 1f1e9e6ee..5e2057aa5 100644 --- a/module/plugins/hoster/FastshareCz.py +++ b/module/plugins/hoster/FastshareCz.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FastshareCz(SimpleHoster): __name__ = "FastshareCz" __type__ = "hoster" - __version__ = "0.24" + __version__ = "0.25" __pattern__ = r'http://(?:www\.)?fastshare\.cz/\d+/.+' @@ -20,8 +20,7 @@ class FastshareCz(SimpleHoster): URL_REPLACEMENTS = [("#.*", "")] - COOKIES = [("fastshare.cz", "lang", "en")] - CONTENT_DISPOSITION = True + COOKIES = [("fastshare.cz", "lang", "en")] INFO_PATTERN = r'<h1 class="dwp">(?P<N>[^<]+)</h1>\s*<div class="fileinfo">\s*Size\s*: (?P<S>\d+) (?P<U>[\w^_]+),' OFFLINE_PATTERN = r'>(The file has been deleted|Requested page not found)' diff --git a/module/plugins/hoster/FileSharkPl.py b/module/plugins/hoster/FileSharkPl.py index ea2b56821..25825a229 100644 --- a/module/plugins/hoster/FileSharkPl.py +++ b/module/plugins/hoster/FileSharkPl.py @@ -10,7 +10,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FileSharkPl(SimpleHoster): __name__ = "FileSharkPl" __type__ = "hoster" - __version__ = "0.03" + __version__ = "0.04" __pattern__ = r'http://(?:www\.)?fileshark\.pl/pobierz/\d{6}/\w{5}' @@ -20,8 +20,6 @@ class FileSharkPl(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - CONTENT_DISPOSITION = True - NAME_PATTERN = r'<h2 class="name-file">(?P<N>.+)</h2>' SIZE_PATTERN = r'<p class="size-file">(.*?)<strong>(?P<S>\d+\.?\d*)\s(?P<U>\w+)</strong></p>' diff --git a/module/plugins/hoster/FilerNet.py b/module/plugins/hoster/FilerNet.py index c943a076d..5dd72efe7 100644 --- a/module/plugins/hoster/FilerNet.py +++ b/module/plugins/hoster/FilerNet.py @@ -15,7 +15,7 @@ from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilerNet(SimpleHoster): __name__ = "FilerNet" __type__ = "hoster" - __version__ = "0.09" + __version__ = "0.10" __pattern__ = r'https?://(?:www\.)?filer\.net/get/\w+' @@ -25,8 +25,6 @@ class FilerNet(SimpleHoster): ("Walter Purcaro", "vuolter@gmail.com")] - CONTENT_DISPOSITION = True - INFO_PATTERN = r'<h1 class="page-header">Free Download (?P<N>\S+) <small>(?P<S>[\w.]+) (?P<U>[\w^_]+)</small></h1>' OFFLINE_PATTERN = r'Nicht gefunden' @@ -66,16 +64,17 @@ class FilerNet(SimpleHoster): if 'location' in header and header['location']: self.correctCaptcha() - self.link = urljoin('http://filer.net', header['location']) + self.link = header['location'] return else: self.invalidCaptcha() - def handlePremium(self): - super(FilerNet, self).handlePremium() - if self.link: - self.link = urljoin("http://filer.net/", self.link) + def downloadLink(self, link): + if not link: + return + + self.download(urljoin("http://filer.net/", link), disposition=True) getInfo = create_getInfo(FilerNet) diff --git a/module/plugins/hoster/Keep2shareCc.py b/module/plugins/hoster/Keep2shareCc.py index cb5e65a29..d98fa3c09 100644 --- a/module/plugins/hoster/Keep2shareCc.py +++ b/module/plugins/hoster/Keep2shareCc.py @@ -11,7 +11,7 @@ from module.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<ID>\w+)' @@ -23,8 +23,6 @@ class Keep2shareCc(SimpleHoster): URL_REPLACEMENTS = [(__pattern__ + ".*", "http://k2s.cc/file/\g<ID>")] - CONTENT_DISPOSITION = True - NAME_PATTERN = r'File: <span>(?P<N>.+)</span>' SIZE_PATTERN = r'Size: (?P<S>[^<]+)</div>' @@ -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) |