From 04038a2cf0c4c2d9cc9a0c8e8bf9beb6426afae8 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 10 Jul 2014 03:02:26 +0200 Subject: Use parseError instead PluginParseError + unified all download pattern attributes as LINK_PATTERN + removed some old patterns (not used anymore) + other code cosmetics --- module/plugins/crypter/GooGl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 15f0a9a8c..343bce5fd 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -27,7 +27,7 @@ class GooGl(Crypter): __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" - API_URL = 'https://www.googleapis.com/urlshortener/v1/url' + API_URL = "https://www.googleapis.com/urlshortener/v1/url" def decrypt(self, pyfile): rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) -- cgit v1.2.3 From 8e47b0de30a25d0fd5dfb518bfe4e1e7beff93fd Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 15 Jul 2014 16:27:44 +0200 Subject: Key attributes cleanup for account, container and crypter plugins --- module/plugins/crypter/GooGl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 343bce5fd..37531c11e 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -20,15 +20,18 @@ from module.common.json_layer import json_loads class GooGl(Crypter): __name__ = "GooGl" + __version__ = "0.01" __type__ = "crypter" + __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' - __version__ = "0.01" + __description__ = """Goo.gl decrypter plugin""" __author_name__ = "stickell" __author_mail__ = "l.stickell@yahoo.it" API_URL = "https://www.googleapis.com/urlshortener/v1/url" + def decrypt(self, pyfile): rep = self.load(self.API_URL, get={'shortUrl': pyfile.url}) self.logDebug('JSON data: ' + rep) -- cgit v1.2.3 From a1e78f33dc2b0b6777fdcbc415673f3965b25542 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Wed, 16 Jul 2014 00:46:26 +0200 Subject: Prefer self.urls and self.packages for adding links --- module/plugins/crypter/GooGl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 37531c11e..52bf93ed3 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -38,6 +38,6 @@ class GooGl(Crypter): rep = json_loads(rep) if 'longUrl' in rep: - self.core.files.addLinks([rep['longUrl']], pyfile.package().id) + self.urls = [rep['longUrl']] else: self.fail('Unable to expand shortened link') -- cgit v1.2.3 From ba916633f2bedb04c7358000b91aed69f52e8e43 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Fri, 1 Aug 2014 19:35:59 +0200 Subject: Remove trailing whitespaces + remove license headers + import urllib methods directly + sort and fix key attributes + use save_join instead join + sort some import declarations + other minor code cosmetics --- module/plugins/crypter/GooGl.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'module/plugins/crypter/GooGl.py') diff --git a/module/plugins/crypter/GooGl.py b/module/plugins/crypter/GooGl.py index 52bf93ed3..1d9c2801f 100644 --- a/module/plugins/crypter/GooGl.py +++ b/module/plugins/crypter/GooGl.py @@ -1,18 +1,4 @@ # -*- coding: utf-8 -*- -############################################################################ -# This program is free software: you can redistribute it and/or modify # -# it under the terms of the GNU Affero General Public License as # -# published by the Free Software Foundation, either version 3 of the # -# License, or (at your option) any later version. # -# # -# This program is distributed in the hope that it will be useful, # -# but WITHOUT ANY WARRANTY; without even the implied warranty of # -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -# GNU Affero General Public License for more details. # -# # -# You should have received a copy of the GNU Affero General Public License # -# along with this program. If not, see . # -############################################################################ from module.plugins.Crypter import Crypter from module.common.json_layer import json_loads @@ -20,8 +6,8 @@ from module.common.json_layer import json_loads class GooGl(Crypter): __name__ = "GooGl" - __version__ = "0.01" __type__ = "crypter" + __version__ = "0.01" __pattern__ = r'https?://(?:www\.)?goo\.gl/\w+' -- cgit v1.2.3