From b0b837650b2f3f85e9533e9cbc56d6140d1929a6 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 14 Dec 2015 03:51:26 +0100 Subject: Crypters version up --- module/plugins/crypter/ImgurCom.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 module/plugins/crypter/ImgurCom.py (limited to 'module/plugins/crypter/ImgurCom.py') diff --git a/module/plugins/crypter/ImgurCom.py b/module/plugins/crypter/ImgurCom.py new file mode 100644 index 000000000..7dd922977 --- /dev/null +++ b/module/plugins/crypter/ImgurCom.py @@ -0,0 +1,34 @@ +import re + +from module.plugins.internal.SimpleCrypter import SimpleCrypter, create_getInfo +from module.plugins.internal.misc import uniqify + + +class ImgurCom(SimpleCrypter): + __name__ = "ImgurCom" + __type__ = "crypter" + __version__ = "0.55" + __status__ = "testing" + + __pattern__ = r'https?://(?:www\.|m\.)?imgur\.com/(a|gallery|)/?\w{5,7}' + __config__ = [("activated" , "bool", "Activated" , True), + ("use_premium" , "bool", "Use premium account if available" , True), + ("use_subfolder" , "bool", "Save package to subfolder" , True), + ("subfolder_per_package", "bool", "Create a subfolder for each package" , True), + ("max_wait" , "int" , "Reconnect if waiting time is greater than minutes", 10 )] + + __description__ = """Imgur.com decrypter plugin""" + __license__ = "GPLv3" + __authors__ = [("nath_schwarz", "nathan.notwhite@gmail.com")] + + + NAME_PATTERN = r'(?P.+?) - Imgur' + LINK_PATTERN = r'i\.imgur\.com/\w{7}s?\.(?:jpeg|jpg|png|gif|apng)' + + + def get_links(self): + f = lambda url: "http://" + re.sub(r'(\w{7})s\.', r'\1.', url) + return uniqify(map(f, re.findall(self.LINK_PATTERN, self.data))) + + +getInfo = create_getInfo(ImgurCom) -- cgit v1.2.3