streamlink / streamlink-twitch-gui

A multi platform Twitch.tv browser for Streamlink
https://streamlink.github.io/streamlink-twitch-gui/
MIT License
2.66k stars 201 forks source link

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

Closed daedrot closed 4 months ago

daedrot commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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: https://github.com/nwjs/nw.js/issues/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 commented 2 years ago

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.

daedrot commented 2 years ago

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!

bastimeyer commented 2 years ago

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

mspyerz commented 2 years ago

I'm from https://github.com/streamlink/streamlink-twitch-gui/issues/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 commented 2 years ago

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.