porjo/youtubeuploader

Can't get request token; Nowhere to paste code

threehappypenguins opened this issue · 1 comments

I reinstalled a headless server (Debian 11) and am now trying to set up youtubeuploader, but I'm stuck on trying to get the request token. I will get something like the following:

Error opening URL: exec: "xdg-open,x-www-browser,www-browser": executable file not found in $PATH

Visit the URL below to get a code.%!(EXTRA string= This program will pause until the site is visited.

%s
, string=https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=xxxxxxxxxxxx-xxxxxxxxxxxxx.apps.googleusercontent.com&prompt=consent&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2callback&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.upload+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutubepartner+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube&state=xxxxxxxxxxxxxxxxxxxxxx)

I will copy https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=xxxxxxxxxxxx-xxxxxxxxxxxxx.apps.googleusercontent.com&prompt=consent&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2callback&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube.upload+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutubepartner+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fyoutube&state=xxxxxxxxxxxxxxxxxxxxxx) and paste in a browser, authorize YouTube, and then I get This site can’t be reached (ERR_CONNECTION_REFUSED), but it's not a problem because I can see the code in the address bar. It's something like:

http://localhost:8080/oauth2callback?state=xxxxxxxxxxxxxxxxxxxxxx)&code=4/0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&scope=https://www.googleapis.com/auth/youtube.upload%20https://www.googleapis.com/auth/youtubepartner%20https://www.googleapis.com/auth/youtube

The code being between &code= and &scope.

The problem is, when I paste the code in my ssh terminal (I'm using puTTY), there isn't really a place to paste it. For example, it lets me paste it right after the link and when I press enter, nothing happens. Or if I press enter first, it gives me a new line. So I paste the code on the new line and press enter, and again, nothing happens. I have to press ctrl + c to exit out.

I also have the same issue on command prompt in Windows (connecting via ssh), so I don't think it's the terminal I'm using.

It tells me to get the code, but there doesn't seem to be a place to enter the code, if that makes sense.

porjo commented

I have recently updated the app to remove the headless authentication option. See #116 for more discussion about that.

Please try the oauth process again on a computer with a browser. After you have generated the request.token file, you can copy that to a remote host which is headless and use it there.