新版 Speedtest API 如何跨地区筛选测速节点 | 格塔里

格塔里

一个不负责任的教程博客

0%

新版 Speedtest API 如何跨地区筛选测速节点

运行脚本

此脚本依赖于 python2/3

1
2
3
4
5
6
7
8
9
10
# 过时的脚本
# curl -s https://gtary.com/script/findlist.py | python - -search="Hong Kong"
# curl -s https://gtary.com/script/speedtest.py | python - --search="Hong Kong"
# curl -s https://gtary.com/script/speedtest.py | python - --search="Hong Kong" --server=13538 --share
# 安装 speedtest-cli
pip install git+https://github.com/du5/speedtest-cli.git
# 搜索节点
speedtest --search="Hong Kong"
# 使用搜索结果中的指定节点 ID 进行测速
speedtest --search="Hong Kong" --server=13538 --share

示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
[root@elrepo ~]# pip install git+https://github.com/du5/speedtest-cli.git
Collecting git+https://github.com/du5/speedtest-cli.git
Cloning https://github.com/du5/speedtest-cli.git to /tmp/pip-req-build-kwzoe3fy
Running command git clone -q https://github.com/du5/speedtest-cli.git /tmp/pip-req-build-kwzoe3fy
Building wheels for collected packages: speedtest-cli
Building wheel for speedtest-cli (setup.py) ... done
Created wheel for speedtest-cli: filename=speedtest_cli-2.1.2-py2.py3-none-any.whl size=23588 sha256=527534a4c5c88ea9320690f8a6c4497d410cc7bea611d0c70b718fe310f2dbc6
Stored in directory: /tmp/pip-ephem-wheel-cache-s1rf2qqu/wheels/ee/52/63/7d32b7104ff95c3383f721de3bc75800eed950d84ccb9f422a
Successfully built speedtest-cli
Installing collected packages: speedtest-cli
Successfully installed speedtest-cli-2.1.2
[root@elrepo ~]# speedtest --search="Hong Kong"
Retrieving speedtest.net configuration...
14903) CSL (Tai Po, Hong Kong) [10530.79 km]
16176) HGC Global Communications Limited (Shatin, Hong Kong) [10534.73 km]
22991) Shanghai Huajuan Information Technology Co., Ltd. (Hong Kong, Hong Kong) [10538.30 km]
13538) CSL (Kwai Chung, Hong Kong) [10539.71 km]
18745) FPT Telecom (Chai Wan, Hong Kong) [10541.78 km]
32553) PassKit, Inc. (Sheung Wan, Hong Kong) [10545.81 km]
1536) STC (Hong Kong, China) [10548.02 km]
21182) Gemnet LLC (Hong Kong, Hong Kong) [10548.02 km]
22126) i3D.net (Hong Kong, Hong Kong) [10548.02 km]
2993) Website Solution Limited (Hong Kong, China) [10548.02 km]
26461) Telin (Hong Kong, Hong Kong) [10548.02 km]
19036) SmarTone (Hong Kong, China) [10548.02 km]
28912) fdcservers.net (Hong Kong, Hong Kong) [10548.02 km]
32155) China Mobile Hong Kong (Hong Kong, Hong Kong) [10548.02 km]
[root@elrepo ~]# speedtest --search="Hong Kong" --server=13538 --share
Retrieving speedtest.net configuration...
Testing from CodecCloud (xxx.xxx.xxx.xx)...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by CSL (Kwai Chung) [10539.71 km]: 161.615 ms
Testing download speed................................................................................
Download: 212.97 Mbit/s
Testing upload speed................................................................................................
Upload: 124.69 Mbit/s
Share results: http://www.speedtest.net/result/9410750395.png
[root@elrepo ~]#

API 参考项目