Update imgur.py to include 'title' of single image (#40)

Add {title} keyword..
Images on Imgur don't necessarily have a title, but I think most of them do, and since this should not break anything else..
This commit is contained in:
H R X N 2017-09-26 12:48:48 +02:00 committed by Mike Fährmann
parent a85f06d2d1
commit 77bf923c56

View File

@ -52,7 +52,7 @@ class ImgurExtractor(Extractor):
class ImgurImageExtractor(ImgurExtractor):
"""Extractor for individual images from imgur.com"""
subcategory = "image"
filename_fmt = "{category}_{hash}.{extension}"
filename_fmt = "{category}_{hash}_{title}.{extension}"
pattern = [(r"(?:https?://)?(?:m\.|www\.)?imgur\.com/"
r"(?:gallery/)?((?!gallery)[^/?&#]{7})/?"),
(r"(?:https?://)?i\.imgur\.com/([^/?&#.]{5,7})\.")]