speedtest-cli icon indicating copy to clipboard operation
speedtest-cli copied to clipboard

403 error fix

Open Loukious opened this issue 2 years ago • 16 comments

Fixing the 403 error by making all requests use HTTPS instead of HTTP. Also removing the --secure flag as it's now enabled by default.

Loukious avatar Oct 17 '22 22:10 Loukious

Please merge as the tool is unusable at the moment

rgaufman avatar Nov 21 '22 13:11 rgaufman

This version doesn't work for me

EVOTk avatar Nov 21 '22 13:11 EVOTk

This version doesn't work for me

Do you have any specific error?

Loukious avatar Nov 21 '22 13:11 Loukious

https://github.com/sivel/speedtest-cli/pull/788#issuecomment-1281859178

image

EVOTk avatar Nov 21 '22 13:11 EVOTk

#788 (comment)

image

Can you try this on Windows?

Loukious avatar Nov 21 '22 13:11 Loukious

no on Linux Debian

EVOTk avatar Nov 21 '22 13:11 EVOTk

no on Linux Debian

Yes but can you try it on Windows?

Loukious avatar Nov 21 '22 14:11 Loukious

I have to modify the first line with "#! python3" for the script run, but I still get the error :

image

EVOTk avatar Nov 21 '22 14:11 EVOTk

Can confirm that on linux (arch). I was originally getting this error until I provided the --secure flag. image I'm pretty sure if you're connecting to speedtest.net then the HTTPS part should be working.

smerkousdavid avatar Nov 21 '22 16:11 smerkousdavid

Where do you provide the '--secure' flag? I'm running speedtest.py through curl. And every time I I try to pass the '--secure' flag to the script in the url, curl gripes at me about it being an unknown option. ([...]/master/speedtest.py --secure | python3 -) Or can you not pass options to the script when running as a url?

darth-crunchus avatar Nov 22 '22 04:11 darth-crunchus

Where do you provide the '--secure' flag? I'm running speedtest.py through curl. And every time I I try to pass the '--secure' flag to the script in the url, curl gripes at me about it being an unknown option. ([...]/master/speedtest.py --secure | python3 -) Or can you not pass options to the script when running as a url?

You're just simply using curl to download the file from GitHub and then telling python to read the contents of the file through stdin using the - after python. You can provide any arguments you want, specifically to the python script, after the - argument like this. Again think of the dash as you telling python that instead of reading from a file on the disk just read from stdin, which in this case you're piping stdout of curl into stdin of python. You might already know this, but just wanted to clarify. curl [...]master/speedtest.py | python3 - --secure Although, I would personally just download the file or use pip to install it.

smerkousdavid avatar Nov 22 '22 05:11 smerkousdavid

Thank you; I'm kinda new to working with curl like this, (or really in much of any capacity) so, I wasn't sure.

darth-crunchus avatar Nov 22 '22 05:11 darth-crunchus

I have speedtest-cli 2.1.3, which I run on Linux (Mint) and occasionally I see the following.

Retrieving speedtest.net configuration...
Cannot retrieve speedtest configuration
ERROR: HTTP Error 403: Forbidden

I am unsure what workaround, if any, this page (the current webpage) is suggesting.

LinuxOnTheDesktop avatar Jun 23 '23 20:06 LinuxOnTheDesktop

@LinuxOnTheDesktop - just run it with the "secure" flag and everything will be good. Provider finally starts blocking HTTP requests and looks like most of their servers allowing only HTTPS protocol: $ speedtest-cli --secure

artickl avatar Jun 27 '23 19:06 artickl

just run it with the "secure" flag and everything will be good.

Right. Thank you. Will do.

Provider finally starts blocking HTTP requests and looks like most of their servers allowing only HTTPS protocol

Yet me clarify that, in case someone else comes across it and has trouble understanding it. So: the servers that provide the speed tests are blocking speedtest-cli (or rather, in my experience: blocking it sometimes) because (by default, i.e. without --secure) speedtest-cli uses HTTP rather than HTTPS.

LinuxOnTheDesktop avatar Jun 28 '23 00:06 LinuxOnTheDesktop

i prefer #800 for the --insecure flag

milahu avatar Nov 26 '23 13:11 milahu