Skip to content

403 forbidden errors with any photo url size above 1024 (except original) #735

@catsncode

Description

@catsncode

Hey thanks so much for the great work on this project! I am using 3.0.4 but did not see any changes in the newer versions that would address this.

I've been using it on a photo gallery for years and yesterday I started getting 403 forbidden errors back from Flickr on all photo URLs for sizes above 1024. They must have changed something and I did open a ticket but based on their response I don't think I'm going to get anywhere with them.

After a lot of digging, I think the problem is with the generated secret in the URL and using the original URL as a base, I found a workaround.

// getLarge1600Url() also fails
// the resulting URL will give a 403 forbidden
String imageUrl = photo.getLargeUrl(); 

// My workaround
// original URL works fine and by replacing the suffix, the large sizes now work
// I guess because the secret for the original was good
String imageUrl = photo.getOriginalUrl();
imageUrl = imageUrl.replace("_o", "_h");

Here is the page that tells about the different secrets. I'm not sure if it's always been this way or not.
https://www.flickr.com/services/api/misc.urls.html

Secrets
All photo image URLs use a secret value that's provided by API methods. All sizes below the H (1600) size use one shared secret. All sizes above and including the H (1600) size each use a unique secret for just themselves. The original size, regardless of dimensions, always uses its own secret.

I'm happy to test any potential fix but I think it will be easy to recreate. Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions