From 68d662e689cd42687341c550fb6ebb74e6968d21 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Mon, 8 Sep 2014 00:29:57 +0200 Subject: module -> pyload --- pyload/plugins/crypter/ImgurComAlbum.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pyload/plugins/crypter/ImgurComAlbum.py (limited to 'pyload/plugins/crypter/ImgurComAlbum.py') diff --git a/pyload/plugins/crypter/ImgurComAlbum.py b/pyload/plugins/crypter/ImgurComAlbum.py new file mode 100644 index 000000000..5e8be3a5d --- /dev/null +++ b/pyload/plugins/crypter/ImgurComAlbum.py @@ -0,0 +1,24 @@ +import re + +from pyload.plugins.internal.SimpleCrypter import SimpleCrypter +from pyload.utils import uniqify + + +class ImgurComAlbum(SimpleCrypter): + __name__ = "ImgurComAlbum" + __type__ = "crypter" + __version__ = "0.4" + + __pattern__ = r'https?://(?:www\.|m\.)?imgur\.com/(a|gallery|)/?\w{5,7}' + + __description__ = """Imgur.com decrypter plugin""" + __author_name_ = "nath_schwarz" + __author_mail_ = "nathan.notwhite@gmail.com" + + TITLE_PATTERN = r'(?P.+) - 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))) -- cgit v1.2.3