Nicoseiga: Add support for drm-served manga
This commit is contained in:
@@ -12,7 +12,10 @@ class NicoSeigaApiClient
|
|||||||
[api_response["id"]]
|
[api_response["id"]]
|
||||||
elsif @work_type == "manga"
|
elsif @work_type == "manga"
|
||||||
manga_api_response.map do |x|
|
manga_api_response.map do |x|
|
||||||
x["meta"]["source_url"].match(%r{/thumb/(\d+)\w}i).captures[0]
|
case x["meta"]["source_url"]
|
||||||
|
when %r{/thumb/(\d+)\w}i then Regexp.last_match(1)
|
||||||
|
when %r{nicoseiga\.cdn\.nimg\.jp/drm/image/\w+/(\d+)\w}i then Regexp.last_match(1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -84,15 +84,10 @@ module Sources
|
|||||||
end
|
end
|
||||||
|
|
||||||
def preview_urls
|
def preview_urls
|
||||||
if manga_id.present?
|
if illust_id.present?
|
||||||
image_urls.map do |img|
|
|
||||||
id = image_id_from_url(img)
|
|
||||||
"https://lohas.nicoseiga.jp/thumb/#{id}p"
|
|
||||||
end
|
|
||||||
elsif illust_id.present?
|
|
||||||
["https://lohas.nicoseiga.jp/thumb/#{illust_id}i"]
|
["https://lohas.nicoseiga.jp/thumb/#{illust_id}i"]
|
||||||
else
|
else
|
||||||
[]
|
image_urls
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user