nicoseiga: support a few more url types.

This commit is contained in:
evazion
2022-03-23 22:18:51 -05:00
parent c07c5ea594
commit 5941c47b79
2 changed files with 38 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ module Source
attr_reader :illust_id, :manga_id, :image_id, :user_id, :username, :profile_url
def self.match?(url)
url.domain.in?(%w[nicovideo.jp nicoseiga.jp nicomanga.jp nimg.jp])
url.domain.in?(%w[nicovideo.jp nicoseiga.jp nicomanga.jp nimg.jp nico.ms])
end
def site_name
@@ -90,6 +90,18 @@ module Source
in "deliver.cdn.nicomanga.jp", *rest
# unhandled
# https://drm.cdn.nicomanga.jp/image/d4a2faa68ec34f95497db6601a4323fde2ccd451_9537/8017978p?1570012695
in "drm.cdn.nicomanga.jp", "image", _, /^(\d+)p$/ => image_id
@image_id = $1
# https://nico.ms/im10922621
in "nico.ms", /^im(\d+)$/
@illust_id = $1
# https://nico.ms/mg310193
in "nico.ms", /^mg(\d+)$/
@manga_id = $1
# https://seiga.nicovideo.jp/user/illust/456831
# https://sp.seiga.nicovideo.jp/user/illust/20542122
# https://ext.seiga.nicovideo.jp/user/illust/20542122