Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hi,
Just a snippet of code to demonstrate the solution to people who arrive here and are still scratching their heads:
import flickr_api
flickr_api.set_keys(api_key = 'my_api_key', api_secret = 'my_secret')
a = flickr_api.auth.AuthHandler()
url = a.get_authorization_url("read")
print url
verifier = raw_input("Verifier code: ")
a.set_verifier(verifier)
a.save("flickr_credentials.dat")
Run the code.
Paste the displayed URL into a browser and accept the permission request.
Copy the oauth_verifier field and paste it into the terminal at the "Verifier code: " prompt.
This should result in the creation of the flickr_credentials.dat credential file which can be used like this:
import flickr_api
flickr_api.set_keys(api_key = 'my_api_key', api_secret = 'my_secret')
flickr_api.set_auth_handler("flickr_credentials.dat")
user = flickr_api.test.login()
print user.getPhotosets()
Hope this helps.
@empireshades

This comment has been minimized.

Copy link
Owner Author

empireshades commented Sep 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.