fopina/pyspeedtest

I get 'Cannot find a test server'

omriravid opened this issue · 10 comments

Hi,

My code is:
st = pyspeedtest.SpeedTest() try: ping = st.ping() download = st.download() upload = st.upload() except Exception as e: logger.warning(f'speed test failure. {e}')
I get 'Cannot find a test server'
Sometimes it works, sometimes it doesn't. Lately it just doesn't..

Any idea why?
Thanks!

I have the same problem, can you please advise?

I have the same problem as well: 'Cannot find a test server'

my guess is: This project probably violates SpeedTest.net's terms of service, so they blocked it. The author tried to get around the block, they blocked it again, and the author gave up. In the intervening two years, any other servers it used as backups either blocked it, or shut down (e.g., speedtest.serv.pt, mentioned in the docs, no longer exists).

@1010Manoj yep its working !!!

Had the same issue and changing

186:        connection = self.connect('www.speedtest.net')

to

186:        connection = self.connect('c.speedtest.net')

also solved it for me.

One way to future-proof this would be allow the class to take an optional argument with the url to the server.

pyspeedtest -s c.speedtest.net
is also working.

Thanks!