imgbrd-grabber icon indicating copy to clipboard operation
imgbrd-grabber copied to clipboard

[Pixiv] 'Open in browser' redirects to wrong link

Open adem4ik opened this issue 2 years ago • 1 comments

Bug description

Pixiv login is set up using OAuth2 (PKCE) and 'Test' button. 'Open in browser' redirects to link like https://app-api.pixiv.net/v1/illust/detail?illust_id=98469978&image_sizes=large .

Steps to reproduce

  1. Search for something on Pixiv
  2. Perform right mouse click on any result
  3. Select 'Open in browser'

Expected behavior

A valid image page is opened in browser. i.e. https://www.pixiv.net/en/artworks/98469978

Context

Screenshots

image image

System information

  • OS: Windows 10
  • Grabber version: 7.9.0 x64

Additional context

N/A

adem4ik avatar Jun 10 '22 05:06 adem4ik

Indeed, that is because the image's data is actually loaded from that link, via the JSON API. However, it would indeed make more sense to always use the HTML "API" to generate those links.

Bionus avatar Jun 24 '22 19:06 Bionus

Hey there, sorry to interject, but i also had this same issue\desire for pixiv to open the proper url that i wanted to share the somewhat very rudimental solution i've found for this problem, it was a similar problem i had with Sankaku not opening the proper post page, so i wondered if i could apply the same solution to pixiv, and it seem to have worked. But i have a disclaimer: keep in mind that i'm an absolute brainlet when it comes to this stuff, and this simple change i've found may actually have caused bigger problems (so far i haven't had issue but i've got no clue really, it'd be better if Bionus stated the stupidity\danger scale of this solution of mine)

Anyway, here it is: i've modified the model.js of pixiv through notepad++, on line 258: i've switched the return line of "https://app-api.pixiv.net/v1/illust/detail?illust_id=" + id + "&image_sizes=large"; with ""https://www.pixiv.net/en/artworks/" + id; This has made so that the open in browser function opens the proper pixiv artworks page, and the details window will have the correct page link as well Again, i've no idea if this causes problems elsewhere, basic search&download seems to have been unaffected by this so it somehow worked for me Screenshot 2022-09-28 000728

UnlimitedArk avatar Sep 27 '22 22:09 UnlimitedArk