这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Austin-Olacsi
Copy link
Contributor

@Austin-Olacsi Austin-Olacsi commented Sep 15, 2023

What does this PR do?

This is my work on adding a pixiv engine to searxng. pixiv is quite similar to deviantart.

Why is this change important?

another sweet engine

How to test this PR locally?

test !pv

Author's checklist

The problem with this engine is that the images do not load, however the image URLs are correct. As you should see in the terminal, we get 403 forbidden- but use https://www.pixiv.net as the referer and the image URLs work perfectly (tested with wget). i just don't know how to get searxng to do this with each individual picture that it gets.

current state of this engine:

test

@Bnyro
Copy link
Member

Bnyro commented Sep 15, 2023

The Referer header in the image request must be set to https://www.pixiv.net/.

You can test it yourself with curl "https://i.pximg.net/c/250x250_80_a2/img-master/img/2020/04/29/05/21/46/81142134_p0_square1200.jpg" -H "Referer:https://www.pixiv.net/"

I don't think we have any logic for that in SearXNG yet, so it would require some refactoring to the image proxy, but in theory we could use the image proxy to set that header for this engine. However, the engine won't be usable without the image proxy of the instance being enabled.

@Austin-Olacsi Austin-Olacsi deleted the branch searxng:master September 30, 2023 09:03
@Austin-Olacsi Austin-Olacsi deleted the master branch September 30, 2023 09:03
@Austin-Olacsi
Copy link
Contributor Author

reminder for myself:

with this modification to webapp.py, this engine works (when the image proxy is enabled):

    request_headers = {
        'User-Agent': gen_useragent(),
        'Accept': 'image/webp,*/*',
        'Referer': 'https://www.pixiv.net/', #added this line!
        'Accept-Encoding': 'gzip, deflate',
        'Sec-GPC': '1',
        'DNT': '1',
    }

i'll try doing some more work on this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants