diff options
author | 2015-12-14 03:51:26 +0100 | |
---|---|---|
committer | 2015-12-27 20:54:33 +0100 | |
commit | b0b837650b2f3f85e9533e9cbc56d6140d1929a6 (patch) | |
tree | 3aff7a226f5f67e0550f9e2c09fa62add65906a0 /module/plugins/crypter/ImgurCom.py | |
parent | Update addons (diff) | |
download | pyload-b0b837650b2f3f85e9533e9cbc56d6140d1929a6.tar.xz |
Crypters version up
Diffstat (limited to 'module/plugins/crypter/ImgurCom.py')
-rw-r--r-- | module/plugins/crypter/ImgurCom.py | 34 |
1 files changed, 34 insertions, 0 deletions
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<N>.+?) - 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) |