From ea58af3c625d90aec6becfd943289e42e4a71a9a Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 2 Jan 2015 02:49:26 +0100 Subject: Code cosmetics --- module/plugins/hoster/LinksnappyCom.py | 5 ----- 1 file changed, 5 deletions(-) (limited to 'module/plugins/hoster/LinksnappyCom.py') diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index 90a47d1ac..b7127c066 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -23,11 +23,6 @@ class LinksnappyCom(MultiHoster): SINGLE_CHUNK_HOSTERS = ('easybytez.com') - def setup(self): - self.chunkLimit = -1 - self.resumeDownload = True - - def handlePremium(self): host = self._get_host(self.pyfile.url) json_params = json_dumps({'link': self.pyfile.url, -- cgit v1.2.3 From fd105f8e51768ec1943cda2375bdfdbe5b0a3951 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 9 Jan 2015 00:35:51 +0100 Subject: "New Year" Update: hoster plugins --- module/plugins/hoster/LinksnappyCom.py | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'module/plugins/hoster/LinksnappyCom.py') diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index b7127c066..aa3466036 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -11,11 +11,11 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" __type__ = "hoster" - __version__ = "0.06" + __version__ = "0.07" __pattern__ = r'https?://(?:[^/]*\.)?linksnappy\.com' - __description__ = """Linksnappy.com hoster plugin""" + __description__ = """Linksnappy.com multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] @@ -23,9 +23,9 @@ class LinksnappyCom(MultiHoster): SINGLE_CHUNK_HOSTERS = ('easybytez.com') - def handlePremium(self): - host = self._get_host(self.pyfile.url) - json_params = json_dumps({'link': self.pyfile.url, + def handlePremium(self, pyfile): + host = self._get_host(pyfile.url) + json_params = json_dumps({'link': pyfile.url, 'type': host, 'username': self.user, 'password': self.account.getAccountData(self.user)['password']}) @@ -40,7 +40,7 @@ class LinksnappyCom(MultiHoster): self.logError(msg, j['error']) self.fail(msg) - self.pyfile.name = j['filename'] + pyfile.name = j['filename'] self.link = j['generated'] if host in self.SINGLE_CHUNK_HOSTERS: @@ -48,19 +48,10 @@ class LinksnappyCom(MultiHoster): else: self.setup() - if self.link != self.pyfile.url: + if self.link != pyfile.url: self.logDebug("New URL: " + self.link) - def checkFile(self): - super(LinksnappyCom, self).checkFile() - - check = self.checkDownload({"html302": "302 Found"}) - - if check == "html302": - self.retry(wait_time=5, reason=_("Linksnappy returns only HTML data")) - - @staticmethod def _get_host(url): host = urlsplit(url).netloc -- cgit v1.2.3 From 92acf49b37c665dca774527f11550c4fcea5f456 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sat, 7 Feb 2015 21:39:43 +0100 Subject: [LinksnappyCom] Fix https://github.com/pyload/pyload/issues/1153 --- module/plugins/hoster/LinksnappyCom.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'module/plugins/hoster/LinksnappyCom.py') diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index aa3466036..5b0fab43a 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -11,46 +11,43 @@ from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo class LinksnappyCom(MultiHoster): __name__ = "LinksnappyCom" __type__ = "hoster" - __version__ = "0.07" + __version__ = "0.08" - __pattern__ = r'https?://(?:[^/]*\.)?linksnappy\.com' + __pattern__ = r'https?://(?:[^/]+\.)?linksnappy\.com' __description__ = """Linksnappy.com multi-hoster plugin""" __license__ = "GPLv3" __authors__ = [("stickell", "l.stickell@yahoo.it")] - SINGLE_CHUNK_HOSTERS = ('easybytez.com') + SINGLE_CHUNK_HOSTERS = ["easybytez.com"] def handlePremium(self, pyfile): - host = self._get_host(pyfile.url) - json_params = json_dumps({'link': pyfile.url, - 'type': host, + host = self._get_host(pyfile.url) + json_params = json_dumps({'link' : pyfile.url, + 'type' : host, 'username': self.user, 'password': self.account.getAccountData(self.user)['password']}) - r = self.load('http://gen.linksnappy.com/genAPI.php', + + r = self.load("http://gen.linksnappy.com/genAPI.php", post={'genLinks': json_params}) + self.logDebug("JSON data: " + r) j = json_loads(r)['links'][0] if j['error']: - msg = _("Error converting the link") - self.logError(msg, j['error']) - self.fail(msg) + self.error(_("Error converting the link")) pyfile.name = j['filename'] - self.link = j['generated'] + self.link = j['generated'] if host in self.SINGLE_CHUNK_HOSTERS: self.chunkLimit = 1 else: self.setup() - if self.link != pyfile.url: - self.logDebug("New URL: " + self.link) - @staticmethod def _get_host(url): -- cgit v1.2.3 From 7d90803262ccbb4fc5296a4dc3ce30fe98f55631 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 25 Mar 2015 23:10:07 +0100 Subject: __config__ cosmetics --- module/plugins/hoster/LinksnappyCom.py | 1 + 1 file changed, 1 insertion(+) (limited to 'module/plugins/hoster/LinksnappyCom.py') diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index 5b0fab43a..87207ab40 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -14,6 +14,7 @@ class LinksnappyCom(MultiHoster): __version__ = "0.08" __pattern__ = r'https?://(?:[^/]+\.)?linksnappy\.com' + __config__ = [("use_premium", "bool", "Use premium account if available", True)] __description__ = """Linksnappy.com multi-hoster plugin""" __license__ = "GPLv3" -- cgit v1.2.3 From 1ef93e913238275f7657d496ba3d2e7eeb5a30a2 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 May 2015 01:06:01 +0200 Subject: Use 'import' instead 'from' --- module/plugins/hoster/LinksnappyCom.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/plugins/hoster/LinksnappyCom.py') diff --git a/module/plugins/hoster/LinksnappyCom.py b/module/plugins/hoster/LinksnappyCom.py index 87207ab40..9c3af4ae3 100644 --- a/module/plugins/hoster/LinksnappyCom.py +++ b/module/plugins/hoster/LinksnappyCom.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- import re - -from urlparse import urlsplit +import urlparse from module.common.json_layer import json_loads, json_dumps from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo @@ -52,7 +51,7 @@ class LinksnappyCom(MultiHoster): @staticmethod def _get_host(url): - host = urlsplit(url).netloc + host = urlparse.urlsplit(url).netloc return re.search(r'[\w-]+\.\w+$', host).group(0) -- cgit v1.2.3