diff options
author | nath_schwarz <nathan.notwhite@gmail.com> | 2014-06-30 13:33:10 +0200 |
---|---|---|
committer | Stefano <l.stickell@yahoo.it> | 2014-06-30 13:33:10 +0200 |
commit | 821ed8c027a19c4a76d6fb81b161711b50ad773d (patch) | |
tree | fbf86fc0f8237edeff398d29b72be7054e8057eb /module/plugins/crypter | |
parent | [Bitshare] Fixed #663 (diff) | |
download | pyload-821ed8c027a19c4a76d6fb81b161711b50ad773d.tar.xz |
[ImgurComAlbum] new crypter
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r-- | module/plugins/crypter/ImgurComAlbum.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/module/plugins/crypter/ImgurComAlbum.py b/module/plugins/crypter/ImgurComAlbum.py new file mode 100644 index 000000000..f05cf553b --- /dev/null +++ b/module/plugins/crypter/ImgurComAlbum.py @@ -0,0 +1,21 @@ +import re + +from module.plugins.internal.SimpleCrypter import SimpleCrypter +from module.utils import uniqify + + +class ImgurComAlbum(SimpleCrypter): + __name__ = "ImgurComAlbum" + __type__ = "crypter" + __version__ = "0.3" + __description__ = """Imgur.com decrypter plugin""" + __pattern__ = r"https?://imgur\.com/(a|gallery|)/?\w{5,7}" + __author_name_ = "nath_schwarz" + __author_mail_ = "nathan.notwhite@gmail.com" + + TITLE_PATTERN = r'(?P<title>.+) - 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))) |