Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Verifier must be unicode text type error during authorization #138

Open
shacker opened this issue Oct 11, 2021 · 1 comment
Open

Verifier must be unicode text type error during authorization #138

shacker opened this issue Oct 11, 2021 · 1 comment

Comments

@shacker
Copy link

shacker commented Oct 11, 2021

Using FlickrAPI 2.4 and Python 3.7.8.

No problem doing read-only calls, but now I need to make a write call. I'm trying to get oauth verification working, with or without the builtin web server, but am a bit confused by the docs, which say "It is only available on the machine the application is running on, and listens on a random port." Do I need to run this server in a separate terminal? What is the startup command for it? Or does it run automagically?

Alternatively, we can use the oob approach. But when I implement the sample code in the docs:

if not flickr.token_valid(perms="write"):
    flickr.get_request_token(oauth_callback="oob")
    authorize_url = flickr.auth_url(perms="write")
    webbrowser.open_new_tab(authorize_url)
    verifier = input("Verifier code: ")
    flickr.get_access_token(verifier)

I get a browser window, click OK, then it crashes on:

    assert isinstance(new_verifier, six.text_type), 'verifier must be unicode text type'
AssertionError: verifier must be unicode text type

I did not see or get prompted to enter a code. Other github issues here point to py2 problems but I'm using python 3.78.

This is a CLI script. Happy to use either method, but oob seems most straightforward. Any idea why this might not be working?

@shacker
Copy link
Author

shacker commented Oct 11, 2021

I should add that after authorizing at Flickr, I'm redirected to

https://localhost:16177/?oauth_token=

and get a "no server running" error, which implies that I need to run a local server... but how?

@shacker shacker changed the title Error removing image from group Verifier must be unicode text type error during authorization Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant