Skip to content

Commit

Permalink
[seiga] support mobile URLs (closes #401)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Aug 28, 2019
1 parent 20fd2d8 commit b2151f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gallery_dl/extractor/seiga.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand All @@ -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):
Expand Down Expand Up @@ -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", {
Expand All @@ -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"),
Expand Down

0 comments on commit b2151f3

Please sign in to comment.