Skip to content

api/pinterest: fallback images to the graphql api - #1552

Open
zImPatrick wants to merge 1 commit into
imputnet:developfrom
zImPatrick:pr/pinterest
Open

api/pinterest: fallback images to the graphql api#1552
zImPatrick wants to merge 1 commit into
imputnet:developfrom
zImPatrick:pr/pinterest

Conversation

@zImPatrick

Copy link
Copy Markdown
Contributor

Pinterest sometimes just doesn't SSR the images into the HTML, so I implemented falling back to the GraphQL API in case no image was found. There's no support for videos in here right now, as they seem to be unaffected. I'd be down to add it if needed

I also tested an older query hash from January and that one also still works, so this should just keep working for a while

lambovl pushed a commit to lambovl/cobalt-WSS that referenced this pull request Aug 27, 2026
combines two upstream PRs that both rewrite the same image-picking block:
- imputnet#1416 by @potatolover68: match only sized/orig pinimg
  urls and pick the largest variant of the pin instead of the first hit
- imputnet#1552 by @zImPatrick: query the graphql api when html
  parsing yields no image at all

deviations from the originals: imputnet#1552 read bestQuality.url before checking
that bestQuality exists (TypeError when a pin has no images_* keys), and
mutated the image objects to store their size — both avoided here.
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.

1 participant