1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 10:42:34 +01:00

[tumblr] add tag-extractor

This commit is contained in:
Mike Fährmann 2016-02-20 15:24:55 +01:00
parent 58a0029bb2
commit f974ea73db
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -96,3 +96,17 @@ class TumblrPostExtractor(TumblrUserExtractor):
def __init__(self, match):
TumblrUserExtractor.__init__(self, match)
self.api_params["id"] = match.group(2)
class TumblrTagExtractor(TumblrUserExtractor):
"""Extract images from a tumblr-user by tag"""
subcategory = "tag"
pattern = [r"(?:https?://)?([^.]+)\.tumblr\.com/tagged/(.+)"]
test = [("http://demo.tumblr.com/tagged/Times Square", {
"url": "a62b4f5dcb838645342b3ec0eb2dfb0342779699",
"keyword": "97e812ffa3319d4e46a91f09ddfbd24c9b97015a",
})]
def __init__(self, match):
TumblrUserExtractor.__init__(self, match)
self.api_params["tagged"] = match.group(2)