diff options
| author | 2015-02-07 21:39:43 +0100 | |
|---|---|---|
| committer | 2015-02-07 21:39:43 +0100 | |
| commit | 92acf49b37c665dca774527f11550c4fcea5f456 (patch) | |
| tree | c4f627b9e0d73169219fc7d736178ad687434f18 /module/plugins | |
| parent | [ExtractArchive] bump version number after #1152 (diff) | |
| download | pyload-92acf49b37c665dca774527f11550c4fcea5f456.tar.xz | |
[LinksnappyCom] Fix https://github.com/pyload/pyload/issues/1153
Diffstat (limited to 'module/plugins')
| -rw-r--r-- | module/plugins/hoster/LinksnappyCom.py | 25 | 
1 files changed, 11 insertions, 14 deletions
| 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): | 
