Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 7: Can't log into twitch from the app #860

Closed
4 tasks done
daedrot opened this issue Jan 31, 2022 · 8 comments
Closed
4 tasks done

Windows 7: Can't log into twitch from the app #860

daedrot opened this issue Jan 31, 2022 · 8 comments

Comments

@daedrot
Copy link

daedrot commented Jan 31, 2022

Checklist

Streamlink Twitch GUI version

v2.0.0

Streamlink version

3.1.1

Operating system, environment and configuration details

Windows 7

Description

I updated SltwitchGUI to 2.0 and streamlink to the latest version and now i cannot log into the app. When i click on "sign in" it starts doing its thing and nothing happens, only the "abort" button is visible instead. I disabled my firewall and have no antivirus, and i have logged it several times in previous versions with no issues. What am i doing wrong and how can i fix it?

Debug log

No response

@bastimeyer
Copy link
Member

When i click on "sign in" it starts doing its thing and nothing happens

What is "its thing"?

As described in the wiki, when authenticating, Streamlink Twitch GUI first starts a local HTTP server (on TCP port 65432), opens the authentication page on Twitch.tv in your system's default web browser and waits for the response from Twitch, where it redirects you to the local HTTP server upon success or failure. If this "doesn't work", then you have blocked permissions for the app to start the local HTTP server, or the hostname localhost does not point to your local system, so the response never arrives.

https://github.com/streamlink/streamlink-twitch-gui/wiki/Twitch.tv-login

how can i fix it

You can use the second login method and log in directly with an OAuth token. Twitch will still redirect you to http://localhost:65432 after a successful login. Copy the token from the parameters of the URL in the web browser's address bar, enable "advanced settings" in the main settings menu of the Twitch GUI, go back to the log in page and enter the OAuth token there via the second button that's now visible.

@daedrot
Copy link
Author

daedrot commented Jan 31, 2022

After i press the button, it changes to "abort" one and is permanently stuck that way until i do abort the process. The browser page never opens and nothing is happening.

How can i get an Oath token? I tried reading twitch instructions but i have no idea what server they are talking about that i need to get one. I remember i copied some id string from twitch page code once to log in long ago but that's it. I can't understand or find understandable instructions for the oath token, what should i do?

@bastimeyer
Copy link
Member

bastimeyer commented Jan 31, 2022

After i press the button, it changes to "abort"

The abort button is for shutting down the local HTTP server if the user never finishes the login in their web browser.

The browser page never opens and nothing is happening.

Well, then NW.js is unable to find the system's default browser. The app simply calls the Shell.openExternal method of NW.js, and this hasn't been changed.
https://github.com/streamlink/streamlink-twitch-gui/blob/v2.0.0/src/app/services/auth/service.js#L127
https://github.com/streamlink/streamlink-twitch-gui/blob/v2.0.0/src/app/services/nwjs.js#L65

Looks like this is a bug in one of the recent NW.js releases on Windows 7 and it doesn't launch the system's default browser:
nwjs/nw.js#7691

Please check the error log:
https://github.com/streamlink/streamlink-twitch-gui/wiki/Parameters#chromium-logging


As a workaround, you can open the following URL in your web browser and use the second login method (as described above), but don't start the local HTTP server via the first/regular login method, because Streamlink Twitch GUI expects the "state" parameter with a random/unique value which it has previously generated, and this is left out here, so a successful redirection to the local HTTP server would result in a failure due to the state parameter being missing in the response.

https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=phiay4sq36lfv9zu7cbqwz2ndnesfd8&redirect_uri=http%3A%2F%2Flocalhost%3A65432%2Fredirect&scope=user:manage:blocked_users%20user:read:blocked_users%20user:read:follows%20user:read:subscriptions%20chat:edit%20chat:read%20whispers:edit%20whispers:read&force_verify=true

How can i get an Oath token?

The "OAuth" token gets generated by Twitch after you successfully log in via their OAuth2 login form.

@bastimeyer
Copy link
Member

Btw, I am not sure if NW.js still officially supports Windows 7, as Windows 7 should've been dropped by Chromium on July 15th 2021, but then got extended for another bit for "critical and security updates".

Streamlink's Windows installer also doesn't support Windows 7 anymore due to the Python 3.9 upgrade, so keep that in mind with the Streamlink 2.4.0 requirement.

@bastimeyer bastimeyer changed the title Can't log into twitch from the app Windows 7: Can't log into twitch from the app Jan 31, 2022
@daedrot
Copy link
Author

daedrot commented Jan 31, 2022

I tried your workaround method and after logging it with my username and password it redirected me to a localhost link. I then copied the access token from it and inserted it into the app manually, and it worked. Thank you a lot!

@daedrot daedrot closed this as completed Jan 31, 2022
@bastimeyer
Copy link
Member

Let's keep this thread open, as other Windows 7 users will probably be affected by that.

@bastimeyer bastimeyer reopened this Jan 31, 2022
@bastimeyer bastimeyer mentioned this issue Feb 14, 2022
4 tasks
@mspyerz
Copy link

mspyerz commented Feb 14, 2022

I'm from #869

I had to make sure scripts could be run on my powershell. I had to redo the process after reinstalling. Auth worked. Ty bastimeyer

@bastimeyer
Copy link
Member

Yes, that's correct, but that's not the topic of this thread. As a sidenote, I've been working on new Streamlink installers. Instead of having just one Windows installer for Streamlink with an embedded Python 3.9 x86 environment, there will be four installers, with Python 3.10 (the latest) and Python 3.8 (support for Windows 7), and x86 / x86_64. See streamlink/streamlink#4390 for all the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants