mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-03-28 06:17:46 +01: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
|
||||
|
||||
%{"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
|
||||
[{"Referer", "https://pixiv.net/"}]
|
||||
else
|
||||
|
@ -29,6 +23,9 @@ defmodule PhilomenaWeb.ScraperPlug do
|
|||
url
|
||||
|> Philomena.Http.get(headers)
|
||||
|> maybe_fixup_params(url, opts, conn)
|
||||
|
||||
_ ->
|
||||
conn
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue