summaryrefslogtreecommitdiffstats
path: root/pyload/plugin/crypter/ImgurComAlbum.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyload/plugin/crypter/ImgurComAlbum.py')
-rw-r--r--pyload/plugin/crypter/ImgurComAlbum.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/pyload/plugin/crypter/ImgurComAlbum.py b/pyload/plugin/crypter/ImgurComAlbum.py
new file mode 100644
index 000000000..e7df57cb6
--- /dev/null
+++ b/pyload/plugin/crypter/ImgurComAlbum.py
@@ -0,0 +1,27 @@
+import re
+
+from pyload.plugin.internal.SimpleCrypter import SimpleCrypter
+from pyload.utils import uniqify
+
+
+class ImgurComAlbum(SimpleCrypter):
+ __name = "ImgurComAlbum"
+ __type = "crypter"
+ __version = "0.51"
+
+ __pattern = r'https?://(?:www\.|m\.)?imgur\.com/(a|gallery|)/?\w{5,7}'
+ __config = [("use_subfolder", "bool", "Save package to subfolder", True),
+ ("subfolder_per_package", "bool", "Create a subfolder for each package", True)]
+
+ __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 getLinks(self):
+ f = lambda url: "http://" + re.sub(r'(\w{7})s\.', r'\1.', url)
+ return uniqify(map(f, re.findall(self.LINK_PATTERN, self.html)))