mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-03-31 00:37:45 +02:00
fixing scraper_plugin to work with Pixiv
This commit is contained in:
parent
76b8820aed
commit
0ff5df14f3
1 changed files with 3 additions and 6 deletions
|
@ -14,12 +14,6 @@ defmodule PhilomenaWeb.ScraperPlug do
|
||||||
conn
|
conn
|
||||||
|
|
||||||
%{"scraper_cache" => url} when not is_nil(url) and url != "" ->
|
%{"scraper_cache" => url} when not is_nil(url) and url != "" ->
|
||||||
url
|
|
||||||
|> Philomena.Http.get()
|
|
||||||
|> maybe_fixup_params(url, opts, conn)
|
|
||||||
|
|
||||||
_ ->
|
|
||||||
conn
|
|
||||||
headers = if String.contains?(url, "pximg.net") do
|
headers = if String.contains?(url, "pximg.net") do
|
||||||
[{"Referer", "https://pixiv.net/"}]
|
[{"Referer", "https://pixiv.net/"}]
|
||||||
else
|
else
|
||||||
|
@ -29,6 +23,9 @@ defmodule PhilomenaWeb.ScraperPlug do
|
||||||
url
|
url
|
||||||
|> Philomena.Http.get(headers)
|
|> Philomena.Http.get(headers)
|
||||||
|> maybe_fixup_params(url, opts, conn)
|
|> maybe_fixup_params(url, opts, conn)
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
conn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue