[deviantart:image] add support for sta.sh URLs

This commit is contained in:
Mike Fährmann
2017-04-17 11:52:16 +02:00
parent 385285932a
commit 0770de0ea1

View File

@@ -74,7 +74,8 @@ class DeviantartUserExtractor(DeviantartExtractor):
class DeviantartImageExtractor(DeviantartExtractor):
"""Extractor for single images from deviantart.com"""
subcategory = "image"
pattern = [r"(?:https?://)?([^\.]+\.deviantart\.com/art/.+-\d+)"]
pattern = [r"(?:https?://)?([^\.]+\.deviantart\.com/art/.+-\d+)",
r"(?:https?://)?(sta\.sh/[a-z0-9]+)"]
test = [
(("http://shimoda7.deviantart.com/art/"
"For-the-sake-of-a-memory-10073852"), {
@@ -85,6 +86,13 @@ class DeviantartImageExtractor(DeviantartExtractor):
("https://zzz.deviantart.com/art/zzz-1234567890", {
"exception": exception.NotFoundError,
}),
("http://sta.sh/01ijs78ebagf", {
"url": "1692cd075059d24657a01b954413c84a56e2de8f",
"keyword": "3faefb555d64e220e0e5526809e79bd4b9112eb2",
}),
("http://sta.sh/abcdefghijkl", {
"exception": exception.NotFoundError,
}),
]
def __init__(self, match):