[500px] API endpoint retired, extractor broken
500px moved to a new API and the old one now rejects everything, so all the 500px extractors fail.
1.32.12, git HEAD 67f689ad19.
$ gallery-dl -v https://500px.com/p/USER/galleries/GALLERYID
[500px][error] An unexpected error occurred: TypeError - 'NoneType' object is not subscriptable
File "gallery_dl/extractor/500px.py", line 133, in metadata
)["profile"]api.500px.com/graphql still answers 200, but the body is:
{"data":null,"errors":[{"message":"A fresh version of 500px is rolling out ... Expected back Sep 10, 2026, 12:00 UTC","extensions":{"code":"1503"}}]}so the ["profile"] on None is just where it first trips.
The web app talks to https://api-neo.500px.com/graphql now (it's in the preconnect link in the page source). I poked at it a bit while getting my own gallery out:
variableshas to be a JSON object. The currentutil.json_dumps(variables)gets youvariables in a POST body should be provided as an object, not a recursively JSON-encoded string.- Two headers are required, both taken from cookies of the same name:
x-500px-device-id(fromx-500px-device-id-prod) andx-500px-csrf-token-prod. Without the first you get a 500, without the second422 CSRF invalid.x-csrf-tokenis unused now. - Different schema, and introspection is off. The queries sit in the site's JS bundles as inlined Apollo ASTs. The relevant ones are
getGalleryById(id: ID!),pageGalleryItems(galleryId: ID!, first: Int!, after: String),getPhotoById(id: ID!)andphotoDownloadUrl(resourceIds: [ID!]!). - For gallery URLs the last path segment is the gallery id; the username isn't needed.
- Image URLs come off the Photo nodes directly (
urls { size_600 size_1024 size_2048 size_4k }), so the/v1/photos?image_size=4096call in_extend()goes away too. Logged out everything caps at 1024px; logged in,size_2048andsize_4kgive 2048.
Separate small thing I hit on the way: --cookies-from-browser firefox copies only cookies.sqlite and not the -wal file. With Firefox running, my 500px cookies were all in the WAL, so it read 123 cookies and none of them from 500px. Copying db, wal and shm together fixes it. Happy to open that separately if you'd rather keep it apart.
Source: mikf/gallery-dl