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

Nothing accessible when using a VPN #706

Closed
1 task done
nosteponsnakey opened this issue Sep 8, 2023 · 29 comments
Closed
1 task done

Nothing accessible when using a VPN #706

nosteponsnakey opened this issue Sep 8, 2023 · 29 comments
Labels
bug Something isn't working

Comments

@nosteponsnakey
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Does not remember log in state when using VPN. After PC restart, app shows as logged in (in settings screen), yet nothing is accessible.

Expected Behavior

Remember log in state.

Steps to reproduce

  1. Start pc and VPN app
  2. Open Spotube and log in with sp_key and sp_ as instructed
  3. Close app
  4. Restart PC
  5. Open app

Operating System

Windows 10, 22H2

Spotube version

3.1.1

Installation source

Website (spotube.netlify.app) or (spotube.krtirtho.dev)

Additional information

If this is not possible to fix due to the VPN causing trouble, please just disregard my stupid report and close this.

Thanks

@nosteponsnakey nosteponsnakey added the bug Something isn't working label Sep 8, 2023
@MerkomassDev
Copy link
Contributor

MerkomassDev commented Sep 8, 2023

That's probably an issue on your end, i use a VPN (OpenVPN hosted on OracleCloud) daily and I don't have such issues
Can you also specify which VPN you're using?

@MerkomassDev
Copy link
Contributor

There's also a possibility that Spotify reset your password due to "suspicious activity". Check your email for a similar message
Screenshot_65

@KRTirtho KRTirtho changed the title Write the title here Nothing accessible when using a VPN Sep 10, 2023
@KRTirtho
Copy link
Owner

I've also tested on multiple platforms (Windows, Linux, Android) with multiple VPNs (Express, Nord) & Tor (Orbit for Android) as well but it worked perfectly fine on every single test

@KRTirtho
Copy link
Owner

@callegar Does these dns resolvers work in you environment?
Spotube uses these to detect offline connection

@KRTirtho
Copy link
Owner

Make sure these DNS resolvers addresses works when using the VPN/proxy/firewall-config

Address Provider Info
1.1.1.1 CloudFlare https://1.1.1.1
1.0.0.1 CloudFlare https://1.1.1.1
8.8.8.8 Google https://developers.google.com/speed/public-dns/
8.8.4.4 Google https://developers.google.com/speed/public-dns/
208.67.222.222 OpenDNS https://use.opendns.com/
208.67.220.220 OpenDNS https://use.opendns.com/

Or you can turn off DNS filtering if it's turned on according to this RounakTadvi/internet_connection_checker#9

@callegar
Copy link

I suppose it is this. Looks like on this network I can only use the DNS assigned by DHCP and no other. Wonder if spotube could include a configuration option about how to detect offline connection (e.g., merely pinging 8.8.8.8) would work.

@ArchangeGabriel
Copy link

Does these dns resolvers work in you environment? Spotube uses these to detect offline connection

I’ve noticed indeed that Spotube (on Android) is making requests to these DNS resolver constantly (I would say roughly every second but did not measure), which is increasing the battery consumption a lot because this is happening even if there is nothing playing currently, so that my phone cannot go to sleep. So combined with being unable to work under some not-so-rare circumstances, this does not seems to be a good method for checking whether network is available…

In the case of Android, I’m pretty sure there is an API available for this (a 30s random search gave me https://stackoverflow.com/questions/65238297/android-how-to-check-internet-connectivity-on-api-level-29-or-higher-in-android).

At the very least I think you should not check constantly, but e.g. only when you fail to access what you actually want to access? And only then produce a “toast” notification, which can be more helpful (you could say either whether there does not seem to be any network connectivity or whether there is one but you cannot access content — maybe this is actually implemented, but ). This would solve most issues reported here, since if everything works people using blocking VPN would not be affected by unneeded checks. ;)

@KRTirtho KRTirtho moved this to Discussion in Spotube Board Oct 14, 2023
@KRTirtho
Copy link
Owner

@ArchangeGabriel here, we're not trying to know if your device Wi-Fi/data is open or not. We're trying to determine whether the device has internet connection (the device can connect + transfer data)

I’ve noticed indeed that Spotube (on Android) is making requests to these DNS resolver constantly (I would say roughly every second but did not measure), which is increasing the battery consumption a lot because this is happening even if there is nothing playing currently, so that my phone cannot go to sleep

The requests are made in the background, and it's roughly every 5 minutes. Also, these are not HTTP requests. Just IP lookup, which are very inexpensive and in theory shouldn't drain your battery. Also, your screen not going dim is nothing to do with Spotube. It's probably your sleep timer
The problem is with VPN/Proxy connection. And the package used under the hood uses cloudflare or google DNS which are often gets overridden by VPNs. So basically the fix is using google.com (or baidu.com for China)

So combined with being unable to work under some not-so-rare circumstances, this does not seems to be a good method for checking whether network is available…

I'm not sure what you're trying to say but this exactly how apps detect offline/network strength

In the case of Android, I’m pretty sure there is an API available for this (a 30s random search gave me https://stackoverflow.com/questions/65238297/android-how-to-check-internet-connectivity-on-api-level-29-or-higher-in-android).

We've a plugin connectivity_plus which uses this very API and this Android API can only detect whether the device has network connection or not. It can't detect if the device have actual internet connection

a 30s random search gave me

Are u challenging me on a who can search fast competition lol 😂

@callegar
Copy link

May I suggest offering also alternate methods to verify whether internet connection is available? This would be important because in many situations (institutional accounts, VPN, ISPs) you may find access to external DNS servers blocked.

One possibility would be to query the system DNS for a host and checking that the DNS returns the right answer.

Yet another possibility and my suggestion is to offer the option to verify connectivity via HTTP. This could be done taking advantage of the mozilla captive portal detector. Connecting to http://detectportal.firefox.com should deliver the string "success" if you have connectivity.

One may want to put the "check connectivity method" (DNS/HTTP) under an option. Even better would be to switch between the two: e.g. try DNS, if that fails switch to HTTP; or try HTTP, if that fails switch to DNS.

@KRTirtho
Copy link
Owner

@callegar

One possibility would be to query the system DNS for a host and checking that the DNS returns the right answer.

This is what InternetAddress.lookup does and even that is having issues because we're querying for domain names for IP such as 8.8.8.8 which are easily blocked by some ISP (which is not legal in some areas) thus now we're using the domain (google.com or baidu.com for China) to get the IP which in theory should work better

Yet another possibility and my suggestion is to offer the option to verify connectivity via HTTP. This could be done taking advantage of the mozilla captive portal detector. Connecting to http://detectportal.firefox.com/ should deliver the string "success" if you have connectivity.
One may want to put the "check connectivity method" (DNS/HTTP) under an option. Even better would be to switch between the two: e.g. try DNS, if that fails switch to HTTP; or try HTTP, if that fails switch to DNS.

Yes I did something similar but with a HTTP HEAD request to google.com or (baidu.com for China) which tends to be faster

@KRTirtho
Copy link
Owner

Everything is updated in Nightly so please check if it works or not

@callegar
Copy link

Nightly is fine. Thanks!!! Can you be so kind to push this also to the flatpak soon?

@KRTirtho
Copy link
Owner

Yea I am planning a release today

@callegar
Copy link

Was mentioning that because I have actually recedived a flatpak update for the package right today, but it is still at 3.1.2 and still failing in my network environment... so another one is coming?

@KRTirtho
Copy link
Owner

Yea

@KRTirtho KRTirtho moved this from Discussion to Deployed in Spotube Board Oct 30, 2023
@github-project-automation github-project-automation bot moved this from Deployed to Done in Spotube Board Oct 30, 2023
@KRTirtho KRTirtho mentioned this issue Nov 15, 2023
1 task
@fxzxmicah
Copy link

No, it hasn't been fixed. The play button is still spinning wildly and never stops.

@KRTirtho
Copy link
Owner

Did you update to 3.2.0?

@fxzxmicah
Copy link

Did you update to 3.2.0?

Of course.

@fxzxmicah
Copy link

Screenshot_20231116_102213
In the web request log I can see that the app is constantly making requests to YouTube.

@KRTirtho
Copy link
Owner

Yes, it's supposed to make requests to YouTube for the Audio. Is YouTube accessible in your region?

@fxzxmicah
Copy link

Is YouTube accessible in your region?

Directly, no, but yes with a VPN (or something like that).

@fxzxmicah
Copy link

fxzxmicah commented Nov 16, 2023

After I turned off and then turned on the option to block sponsors, I restarted the application again and it seems to have returned to normal for now.
Network requests also seem to have returned to normal. It turns out that crazily making requests looks like launching a ddos attack on www.youtube.com. Now it only requests www.youtube.com a few times and then makes some requests to googlevideo.com instead.

No, I am wrong. I'm not sure what to do anymore. It was indeed normal for a while just now.

@KRTirtho
Copy link
Owner

Ok, change "Settings" > "API Type" to "Piped" and "Settings" > "Piped Server Instance" to "drgns.space"

@fxzxmicah
Copy link

Ok, change "Settings" > "API Type" to "Piped" and "Settings" > "Piped Server Instance" to "drgns.space"

I tried several times but it didn't work.

@KRTirtho
Copy link
Owner

You can try the nightly version, which includes the new JioSaavn based Audio API. And as far as I know, JioSaavn is available in China too

@KRTirtho
Copy link
Owner

I'm planning to implement the Kuwo following feeluown-kuwo for the Chinese users. If anyone want to help, we're open to it

@fxzxmicah
Copy link

I don't know why it's not working. I can use YouTube with my vpn on, but I can't use spotube at the same time (mostly).

@ArchangeGabriel
Copy link

@ArchangeGabriel here, we're not trying to know if your device Wi-Fi/data is open or not. We're trying to determine whether the device has internet connection (the device can connect + transfer data)

I’ve noticed indeed that Spotube (on Android) is making requests to these DNS resolver constantly (I would say roughly every second but did not measure), which is increasing the battery consumption a lot because this is happening even if there is nothing playing currently, so that my phone cannot go to sleep

The requests are made in the background, and it's roughly every 5 minutes. Also, these are not HTTP requests. Just IP lookup, which are very inexpensive and in theory shouldn't drain your battery. Also, your screen not going dim is nothing to do with Spotube. It's probably your sleep timer The problem is with VPN/Proxy connection. And the package used under the hood uses cloudflare or google DNS which are often gets overridden by VPNs. So basically the fix is using google.com (or baidu.com for China)

My screen was going off, that’s not what I meant by not going to sleep. I’m using a tool to measure the time spent screen on/off and in sleep/deep sleep. With the previous release of Spotube making network request every second (actually looked at the firewall log this time), it could not go to deep sleep nor sleep. Now it does. :)

So combined with being unable to work under some not-so-rare circumstances, this does not seems to be a good method for checking whether network is available…

I'm not sure what you're trying to say but this exactly how apps detect offline/network strength

In the case of Android, I’m pretty sure there is an API available for this (a 30s random search gave me https://stackoverflow.com/questions/65238297/android-how-to-check-internet-connectivity-on-api-level-29-or-higher-in-android).

We've a plugin connectivity_plus which uses this very API and this Android API can only detect whether the device has network connection or not. It can't detect if the device have actual internet connection

OK I see the difference here. But as I said before, you should only try to check that if you can’t access otherwise, not constantly.

Anyway, with the release of Spotube that went out with the changes closing this issue, everything is working perfectly fine now (well, except that for some reason the app is now displayed as “App Killer Manager”, but I don’t really mind ^^), so for me that’s all there is to know. ;) Thanks for your work on this project !

@KRTirtho KRTirtho moved this from Done to Deployed in Spotube Board Nov 27, 2023
@fxzxmicah
Copy link

fxzxmicah commented Nov 28, 2023

I don't know what went wrong. I can actually use JioSaavn without using a VPN. But after switching to JioSaavn API in the application, even if I turn off the VPN, the application is still unusable, just like any other APIs.
It seems that after I deleted all the play queue songs and added them again, everything went back to normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Deployed
Development

No branches or pull requests

6 participants