1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-01-31 11:41:35 +01:00

[seiga] support mobile URLs (closes #401)

This commit is contained in:
Mike Fährmann 2019-08-28 22:56:43 +02:00
parent 20fd2d8450
commit b2151f3928
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -70,7 +70,7 @@ class SeigaUserExtractor(SeigaExtractor):
subcategory = "user"
directory_fmt = ("{category}", "{user[id]}")
filename_fmt = "{category}_{user[id]}_{image_id}.{extension}"
pattern = (r"(?:https?://)?(?:www\.|seiga\.)?nicovideo\.jp/"
pattern = (r"(?:https?://)?(?:www\.|(?:sp\.)?seiga\.)?nicovideo\.jp/"
r"user/illust/(\d+)(?:\?(?:[^&]+&)*sort=([^&#]+))?")
test = (
("https://seiga.nicovideo.jp/user/illust/39537793", {
@ -96,6 +96,7 @@ class SeigaUserExtractor(SeigaExtractor):
}),
("https://seiga.nicovideo.jp/user/illust/39537793"
"?sort=image_view&target=illust_all"),
("https://sp.seiga.nicovideo.jp/user/illust/39537793"),
)
def __init__(self, match):
@ -167,6 +168,7 @@ class SeigaImageExtractor(SeigaExtractor):
filename_fmt = "{category}_{image_id}.{extension}"
pattern = (r"(?:https?://)?(?:"
r"(?:seiga\.|www\.)?nicovideo\.jp/(?:seiga/im|image/source/)"
r"|sp\.seiga\.nicovideo\.jp/seiga/#!/im"
r"|lohas\.nicoseiga\.jp/(?:thumb|(?:priv|o)/[^/]+/\d+)/)(\d+)")
test = (
("https://seiga.nicovideo.jp/seiga/im5977527", {
@ -177,6 +179,7 @@ class SeigaImageExtractor(SeigaExtractor):
"exception": exception.NotFoundError,
}),
("https://seiga.nicovideo.jp/image/source/5977527"),
("https://sp.seiga.nicovideo.jp/seiga/#!/im5977527"),
("https://lohas.nicoseiga.jp/thumb/5977527i"),
("https://lohas.nicoseiga.jp/priv"
"/759a4ef1c639106ba4d665ee6333832e647d0e4e/1549727594/5977527"),