-
Notifications
You must be signed in to change notification settings - Fork 2
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
Can't login: browser won't start up #2
Comments
Hey, thanks for writing this issue!
So tl;dr: If this doesn't fix the problem, you can try to test if the SO_REUSEADDR flag is actually set, by temporarily adding a little print statement next to the corresponding line in the python library. This is should be in the function server_bind of class TCPServer in the file /usr/lib/python3.9/socketserver.py. |
Thank you for responding! I'm really sorry about the delay. So I think the error was actually because the browser wasn't starting with the authorization page. And I thought it wasn't working and I hit the submit button again. The browser starts up when I hit the browser automation checkbox, but not otherwise. But I'm on a pinephone so I don't think the browser automation feature works. So I need to figure out how to get the browser to open without the automation method. I at least think thats the issue, I'll try and find more details. |
I got it to work by installing on my laptop and copying the auth_token in the cache folder to my phone. Will there be any problem with this in the future? |
I also wrote a nix expression to install on my laptop, so if anyone else uses nix/nixos: https://gist.github.com/Pacman99/05dc55c8f5b51bab0b020b891022023a. |
Hey, great to hear it works now! The behavior of firefox starting, but not loading the page, when using the automation feature on the pinephone is also what happens for me. I don't know why that is :( Regarding your workaround: I think it should work, as long as your don't clear the cache (the token). I'm not entirely sure though. Maybe spotify will automatically log you out after a while. I don't know about that. And as this project is still very much work in progress, it might happen, that I'll reorder the cache structure or change the authentication, which might cause issues. Should be fine for now, though. I would appreciate, if you could try setting the BROWSER environment variable and update me on if it works then! Also, I wonder if I should link the nix expression in the README.md |
Yeah look at that, I ran
But it did get an auth_token and connected fine after that. |
For the nix expression, the best thing would be to merge it into nixpkgs and I can send the PR for the application whenever you're ready with the first release, I'm already a maintainer there. I've found it to be a useful development tool too, and I've seen nix expressions like this either just as a default.nix in the root of projects or in a nix folder. The expression I made also has a patch to remove you're postinstall.py script from the meson.build because those tasks are already done with the wrapGApps hook and so the script conflicts. So I would recommend a nix folder since there are two files. If you want it, I can clean up my expression and submit a PR here. You can also just link the gist in the readme, I'll try to keep that updated. |
I tried reproducing this by installing epiphany on the pinephone myself, but had no luck. The broken pipe error means, that apparently the browser closed the connection before the server was able to send the full html page (the server in this case is just a simple server the spotipy library starts). The browser probably closed the connection due to a timeout, as you reported that it was hanging for quite a while. Question is: why was it hanging? I think this might just come down to the pinephone's performance. So the browser might request the page, but the pinephone is too busy handling the browser, the app and just plain existance. So the server isn't able to send in time and it breaks. Did spotipyne crash/did you have to restart to get logged in? Because in this case, I could try to at least fix that. Otherwise I don't know if there is much I can do. |
Also, I just realized I completely forgot to address your comments unrelated to the issue, so here it goes:
Glad you enjoy the app! I actually plan to add a button somewhere to start spotifyd from inside the app and add an option to autostart it with the app.
|
About the nix expression: I would happily merge a pull request. Adding it inside a folder sounds like a good idea! |
Ohh Yeah I completely forgot to mention, I did try it a second time and it didn't work at all. Like even the socket error didn't come up. So even though thats an error, I think it does manage to get the auth token right before it errors out. But the second time I tried it, nothing happened epiphany just kept trying to load the redirect uri.
Yeah this could be it, but I think there might be more to it. The pinephone didn't feel slow at any point during this process. And I think spotipy uses flask internally, which is pretty minimal and doesn't usually have these problems. Have you gotten it to work with firefox, w/o the browser automation? Firefox should be even worse than epiphany in terms of resource usage. |
Oh wow both features would be really cool, I'm looking forward to it. If you create issues for features or tasks that need to be completed(or just say them) I might be able to help tackle some of them.
Okay sounds good, I'll try and send something soon.
Yeah of course, take your time! |
Yes, normal firefox works just fine. I'm not really sure what to do about this. I created a little branch, with a little check that should suppress the error output, when the pipe breaks. Doesn't solve the problem though.. :/
That would be cool! |
Interesting, this is something I might need to debug more then. Firefox doesn't start up at all unless I hit the browser automation. But the browser automation doesn't even though it gets firefox to startup. A general workaround could also be to display the url with some text saying, if the browser doesn't open for you go to this link. But that wouldn't help with the broken pipe error. I think the broken pipe error might be a separate issue altogether.
Yeah this project is really great, I was hoping for a native spotify app on my phone and I would definitely like to use it on my laptop at some point if it gets to be on par with the official spotify app.
Yeah I haven't done that much either, this is definitely new for me too. I'll go through the issues you posted and try and figure out what I could work on. |
That sound like a good idea.
Yeah, I think a good start would be to catch the exception and just log a warning. #15 |
I tried to login through the app and with setting the username as an environmental variable and I get this error:
OSError: [Errno 98] Address already in use
Here is the full python error trace:
log
I checked the spotify github issues and they said this error happens when another service is bound to port 8080, but I checked and theres nothing.
This is the output of
sudo netstat -tulpn
:Thank you for writing this app! I can't wait to try it out once I'm able to login. I would appreciate any help with this problem.
The text was updated successfully, but these errors were encountered: