├── CN_Mobile.csv ├── CN_Unicom.csv ├── CN_Telecom.csv ├── ls_sg_hk_jp.csv ├── .github ├── FUNDING.yml └── workflows │ └── main.yml ├── CN.csv ├── LICENSE ├── JP.csv ├── HK.csv ├── README.md ├── SG.csv ├── TW.csv └── main.py /CN_Mobile.csv: -------------------------------------------------------------------------------- 1 | 16204,CN,China,Suzhou,36.156.46.51,speedtest.jsqiuying.com,8080,JSQY - Suzhou 2 | -------------------------------------------------------------------------------- /CN_Unicom.csv: -------------------------------------------------------------------------------- 1 | 24447,CN,China,上海5G,210.22.155.34,mobile.shunicomtest.com.prod.hosts.ooklaserver.net,8080,China Unicom 5G 2 | -------------------------------------------------------------------------------- /CN_Telecom.csv: -------------------------------------------------------------------------------- 1 | 5396,CN,China,Suzhou5G,115.169.22.130,4gsuzhou1.speedtest.jsinfo.net.prod.hosts.ooklaserver.net,8080,China Telecom JiangSu 5G 2 | 36663,CN,China,Zhenjiang5G,115.168.74.186,5gzhenjiang.speedtest.jsinfo.net.prod.hosts.ooklaserver.net,8080,China Telecom JiangSu 5G 3 | 59386,CN,China,浙江,61.130.56.1,cesu-hz.zjtelecom.com.cn.prod.hosts.ooklaserver.net,8080,浙江电信 4 | 59387,CN,China,浙江,61.153.82.77,cesu-nb.zjtelecom.com.cn.prod.hosts.ooklaserver.net,8080,浙江电信 5 | -------------------------------------------------------------------------------- /ls_sg_hk_jp.csv: -------------------------------------------------------------------------------- 1 | id,country_code,country,city,ip,host,port,supplier 2 | 56370,CA,United States,洛杉矶,66.114.152.44,speedtest.la2.gigabitnow.com.prod.hosts.ooklaserver.net,8080,GigabitNow 3 | 68177,DE,United Germany,法兰克福,66.206.25.57,speedtest.fra1.hivelocity.net.prod.hosts.ooklaserver.net,8080,Hivelocity 4 | 64839,SG,Singapore,新加坡,103.176.59.15,speedtest.sin.atharva.co.id.prod.hosts.ooklaserver.net,8080,Atharva 5 | 33414,HK,Hong Kong,中国香港,124.217.179.181,speedtest.three.com.hk,8080,Hutchison HK 6 | 56935,JP,Japan,日本东京,109.123.228.91,tyo.speedtest.contabo.net,8080,Contabo 7 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: spiritlhl 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /CN.csv: -------------------------------------------------------------------------------- 1 | id,country_code,country,city,ip,host,port,supplier 2 | 5396,CN,China,Suzhou,115.169.22.130,4gsuzhou1.speedtest.jsinfo.net.prod.hosts.ooklaserver.net,8080,China Telecom JiangSu 5G 3 | 16204,CN,China,Suzhou,36.156.46.51,speedtest.jsqiuying.com,8080,JSQY - Suzhou 4 | 17265,CN,Taiwan,Zhonghe,211.77.43.18,fetsz1.seed.net.tw.prod.hosts.ooklaserver.net,8080,FarEasTone Telecom 5 | 24447,CN,China,Shanghai,210.22.155.34,mobile.shunicomtest.com.prod.hosts.ooklaserver.net,8080,China Unicom 5G 6 | 30852,CN,China,Kunshan,180.208.59.230,speedtest.dukekunshan.edu.cn,8080,Duke Kunshan University 7 | 36663,CN,China,Zhenjiang,115.168.74.186,5gzhenjiang.speedtest.jsinfo.net.prod.hosts.ooklaserver.net,8080,China Telecom JiangSu 5G 8 | 59386,CN,China,HangZhou,61.130.56.1,cesu-hz.zjtelecom.com.cn.prod.hosts.ooklaserver.net,8080,浙江电信 9 | 59387,CN,China,NingBo,61.153.82.77,cesu-nb.zjtelecom.com.cn.prod.hosts.ooklaserver.net,8080,浙江电信 10 | 73010,CN,Pakistan,Helan,103.19.48.70,arslantel.online.prod.hosts.ooklaserver.net,8080,Arslan Telecom 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 spiritLHLS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Update 2 | 3 | on: 4 | push: 5 | paths: 6 | - 'HK.csv' 7 | workflow_dispatch: 8 | 9 | jobs: 10 | update: 11 | runs-on: ubuntu-latest 12 | timeout-minutes: 15 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Setup Python environment 18 | uses: actions/setup-python@v2 19 | with: 20 | python-version: 3.8 21 | 22 | - name: Install dependencies 23 | run: | 24 | pip install pypinyin 25 | 26 | - name: Run main.py script 27 | run: | 28 | ls 29 | python main.py 30 | ls 31 | 32 | - name: Update README.md with current date 33 | run: | 34 | date_str=$(date +'%Y/%m/%d') 35 | sed -i "s#^数据更新时间:.*#数据更新时间: ${date_str}#" README.md 36 | 37 | 38 | - name: Configure Git 39 | run: | 40 | git config --global user.name "update" 41 | git config --global user.email "tg@spiritlhl.top" 42 | 43 | - name: Add files to Git staging area 44 | run: | 45 | ls 46 | pwd 47 | git add . 48 | 49 | - name: Check Git status 50 | run: | 51 | git branch -a 52 | git remote -v 53 | git status 54 | 55 | - name: Commit changes 56 | run: | 57 | ( 58 | git commit -m "Update CSV files" 59 | ) || true 60 | 61 | 62 | 63 | - name: Push changes 64 | uses: ad-m/github-push-action@master 65 | with: 66 | github_token: ${{ secrets.GITHUB_TOKEN }} 67 | -------------------------------------------------------------------------------- /JP.csv: -------------------------------------------------------------------------------- 1 | id,country_code,country,city,ip,host,port,supplier 2 | 6405,JP,Japan,日本Misawa,27.0.31.50,sp3.atcc-gns.net.prod.hosts.ooklaserver.net,8080,Allied Telesis Capital Corporation 3 | 7139,JP,Japan,日本Tsukuba,103.41.63.43,speedtest.softether.co.jp.prod.hosts.ooklaserver.net,8080,SoftEther Corporation 4 | 9022,JP,Japan,高知KingsBroadband,103.72.176.6,speedtest.kingsbroadband.net.prod.hosts.ooklaserver.net,8080,Kings Broadband 5 | 10112,JP,Japan,高知Jio,49.45.64.214,kochooklaspeed1.jioconnect.com.prod.hosts.ooklaserver.net,8080,Jio 6 | 14623,JP,Japan,日本Bunkyo,103.95.184.74,speed.coe.ad.jp.prod.hosts.ooklaserver.net,8080,IPA CyberLab 7 | 21118,JP,Japan,日本Naha,103.13.250.27,speedtest-xg-oki.glbb.ne.jp.prod.hosts.ooklaserver.net,8080,GLBB Japan 8 | 24333,JP,Japan,"东京RakutenMobile,Inc",103.124.1.250,ookla.mbspeed.net,8080,"Rakuten Mobile, Inc" 9 | 27628,JP,Japan,高知DensLtd,112.196.178.246,kochi1.denbroadband.in,8080,Den Networks Ltd 10 | 28910,JP,Japan,东京fdcservers,50.7.159.210,speedtest.hnd.fdcservers.net,8080,fdcservers.net 11 | 31181,JP,Japan,冲绳AlliedTelesis,27.0.31.66,sp7.atcc-gns.net.prod.hosts.ooklaserver.net,8080,Allied Telesis Capital Corp. 12 | 48463,JP,Japan,东京IPACyberLab400G,219.100.92.232,speed.udx.icscoe.jp,8080,IPA CyberLab 400G 13 | 50467,JP,Japan,东京Verizon,210.81.6.58,jp-nperf.verizon.net.prod.hosts.ooklaserver.net,8080,Verizon 14 | 56935,JP,Japan,东京Contabo,109.123.228.91,tyo.speedtest.contabo.net,8080,Contabo 15 | 61707,JP,Japan,高知BHARATSANCHARNIGAMLTD,117.250.238.209,bsnlooklaekm.mywire.org.prod.hosts.ooklaserver.net,8080,BHARAT SANCHAR NIGAM LTD 16 | 65197,JP,Japan,日本Chiba,114.16.207.6,speedtest.kairun.jp.prod.hosts.ooklaserver.net,8080,Kairun Services 17 | 69360,JP,Japan,日本Ota,154.68.228.14,ookla.blazzinghost.com.prod.hosts.ooklaserver.net,8080,Speedlink Hi-Tech Solutions 18 | 69575,JP,Japan,东京NearouteLimited,209.146.123.56,ty-bgp-speedtest.nearoute.io.prod.hosts.ooklaserver.net,8080,Nearoute Limited 19 | 69792,JP,Japan,东京SpaceCore.pro|PremiumVPSHosting,46.250.248.56,tyo.st.spacecore.pro.prod.hosts.ooklaserver.net,8080,SpaceCore.pro | Premium VPS Hosting 20 | 71524,JP,Japan,高知PeakAirpvt.Ltd,103.214.235.242,speedtest1.peakair.in.prod.hosts.ooklaserver.net,8080,PeakAir pvt. Ltd 21 | -------------------------------------------------------------------------------- /HK.csv: -------------------------------------------------------------------------------- 1 | id,country_code,country,city,ip,host,port,supplier 2 | 1536,HK,Hong Kong,香港STC,219.76.98.50,suntechspeedtest.com.prod.hosts.ooklaserver.net,8080,STC 3 | 13538,HK,Hong Kong,香港CSL,203.210.2.91,csl.hkspeedtest.com.prod.hosts.ooklaserver.net,8080,CSL 4 | 28912,HK,Hong Kong,香港fdcservers,50.7.251.4,lg-hkg.fdcservers.net,8080,fdcservers.net 5 | 32155,HK,Hong Kong,香港HongKong,182.239.125.254,speedtest.hk.chinamobile.com,8080,CMHK Mobile Service 6 | 33414,HK,Hong Kong,香港HutchisonHK,124.217.179.181,speedtest.three.com.hk,8080,Hutchison HK 7 | 35791,HK,Hong Kong,香港SmarTone,203.78.41.10,kami.smartone.com.prod.hosts.ooklaserver.net,8080,SmarTone 8 | 37390,HK,Hong Kong,香港HGC環電,210.0.250.30,ookla-speedtest-central.hgconair.hgc.com.hk,8080,HGC環電 9 | 37639,HK,Hong Kong,香港HongKong,182.239.94.254,speedtestbb.hk.chinamobile.com,8080,CMHK Broadband 10 | 43356,HK,Hong Kong,香港1010,203.210.4.91,1010.hkspeedtest.com.prod.hosts.ooklaserver.net,8080,1010 11 | 44340,HK,Hong Kong,香港HongKong,210.57.36.162,hkthspeedtest02.telstraglobal.net.prod.hosts.ooklaserver.net,8080,Telstra International 12 | 44745,HK,Hong Kong,香港Misaka,156.0.200.220,hk-hkg12.speed.misaka.one,8080,"Misaka Network, Inc." 13 | 48446,HK,Hong Kong,香港GSLs,202.165.70.3,hk1.speedtest.gslnetworks.com.prod.hosts.ooklaserver.net,8080,GSL Networks 14 | 57571,HK,Hong Kong,香港CMC,203.171.30.36,hkgspeedtest.cmctelecom.vn.prod.hosts.ooklaserver.net,8080,CMC Telecom 15 | 57779,HK,Hong Kong,香港ラタトスク,61.244.99.206,hoshiyomi.ratatoskr.org.prod.hosts.ooklaserver.net,8080,ラタトスク 16 | 60177,HK,Hong Kong,香港HongKong,203.210.2.92,hkt.hkspeedtest.com.prod.hosts.ooklaserver.net,8080,Club SIM by HKT 17 | 60178,HK,Hong Kong,香港SunMobile,203.210.4.92,sunmobile.hkspeedtest.com.prod.hosts.ooklaserver.net,8080,Sun Mobile 18 | 61296,HK,Hong Kong,香港HKIX,202.45.189.2,speedtest1c.hkix.net.prod.hosts.ooklaserver.net,8080,HKIX 19 | 62193,HK,Hong Kong,香港HongKong,103.77.210.183,speedtest.hk210.hkg.cn.ctcsci.com.prod.hosts.ooklaserver.net,8080,CTCSCI TECH LTD 20 | 63143,HK,Hong Kong,香港Netvigator,218.102.20.42,hkspeedtest.netvigator.com.prod.hosts.ooklaserver.net,8080,Netvigator 21 | 65463,HK,Hong Kong,香港HKBN,203.185.10.2,speedtest21.hkbn.net.prod.hosts.ooklaserver.net,8080,HKBN 22 | 67826,HK,Hong Kong,香港FPT,1.52.247.4,speedtesthkg.fpt.vn.prod.hosts.ooklaserver.net,8080,FPT Telecom 23 | 68983,HK,Hong Kong,香港RETN,103.194.237.34,speedtest-hkg.retn.net.prod.hosts.ooklaserver.net,8080,RETN 24 | 69119,HK,Hong Kong,香港RFCHOST,198.176.54.23,speedtest.rfchost.net.prod.hosts.ooklaserver.net,8080,RFCHOST 25 | 69574,HK,HongKong,香港HongKong,154.18.170.27,hk-bgp-speedtest.nearoute.io.prod.hosts.ooklaserver.net,8080,Nearoute Limited 26 | 70128,HK,Hong Kong,香港HongKong,115.42.62.244,hkg.02.speedtest.kansuiun.com.prod.hosts.ooklaserver.net,8080,"Kansuiun Co., Ltd" 27 | 72331,HK,Hong Kong,香港MistNet,141.11.133.99,hk01.bigball.top.prod.hosts.ooklaserver.net,8080,MistNet 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # speedtest.net-CN-ID 2 | 3 | [![Update](https://github.com/spiritLHLS/speedtest.net-CN-ID/actions/workflows/main.yml/badge.svg)](https://github.com/spiritLHLS/speedtest.net-CN-ID/actions/workflows/main.yml) 4 | 5 | 6 | 7 | ## 说明 8 | 9 | 数据每天更新一次,感谢官方测速站点提供的服务 10 | 11 | 这里只展示部分地区的节点信息(全部CN地区和部分全球地区),含 speedtest.net 的测速地址,且只保证节点列表的可用性而不是完整性,官网说有1.6万个节点我只爬了1.4万个左右 12 | 13 | 定期自动更新爬取到的测速节点ID,闭源爬虫,自动推送 14 | 15 | 闭源收录服务器数量(实时):13686 16 | 17 | 数据更新时间: 2025/12/20 18 | 19 | ### 对应 [speedtest.net](https://www.speedtest.net/) 的自动更新测速服务器ID的测速脚本 20 | 21 | ``` 22 | bash <(wget -qO- bash.spiritlhl.net/ecs-net) 23 | ``` 24 | 25 | 或 26 | 27 | ``` 28 | bash <(wget -qO- --no-check-certificate https://github.com/spiritLHLS/ecsspeed/raw/main/script/ecsspeed-net.sh) 29 | ``` 30 | 31 | 或国内用 32 | 33 | ``` 34 | bash <(wget -qO- --no-check-certificate https://ghproxy.com/https://raw.githubusercontent.com/spiritLHLS/ecsspeed/main/script/ecsspeed-net.sh) 35 | ``` 36 | 37 |
38 | 39 | 支持测速的架构:i386, x86_64, amd64, arm64, s390x, riscv64, ppc64le, ppc64 40 | 41 | 涵盖中国三大运营商、香港、台湾的测速节点,默认的三网测速每个运营商选择本机ping值最低的两个节点测速,详情三网测速才是全测,节点列表大概每7天自动更新一次。 42 | 43 | 支持国内服务器测试(有判断是否为国内机器),但由于国内服务器带宽过小,会很慢,详见初次运行的显示 44 | 45 | 当官方CLI安装失败(如罕见的架构或者官方网站访问失败时)自动使用 [speedtest-go](https://github.com/showwin/speedtest-go) 作为替代品测速 46 | 47 |
48 | 49 | ## 交流 50 | 51 | https://t.me/spiritlhl_bot 52 | 53 | # 免责声明 54 | 55 | * 本仓库仅供学习使用。 56 | * 不可用于商业以及非法目的,使用本仓库代码产生的一切后果, 作者不承担任何责任。 57 | * 本仓库链接仅网络收集,侵权告知必删,使用相关链接产生的一切后果,作者不承担任何责任。 58 | 59 | ## Special statement: 60 | 61 | Any unlocking and decryption analysis scripts involved in the Script project released by this warehouse are only used for testing, learning and research, and are forbidden to be used for commercial purposes. Their legality, accuracy, completeness and effectiveness cannot be guaranteed. Please make your own judgment based on the situation. . 62 | 63 | All resource files in this project are forbidden to be reproduced or published in any form by any official account or self-media. 64 | 65 | This warehouse is not responsible for any script problems, including but not limited to any loss or damage caused by any script errors. 66 | 67 | Any user who indirectly uses the script, including but not limited to establishing a VPS or disseminating it when certain actions violate national/regional laws or related regulations, this warehouse is not responsible for any privacy leakage or other consequences caused by this. 68 | 69 | Do not use any content of the Script project for commercial or illegal purposes, otherwise you will be responsible for the consequences. 70 | 71 | If any unit or individual believes that the script of the project may be suspected of infringing on their rights, they should promptly notify and provide proof of identity and ownership. We will delete the relevant script after receiving the certification document. 72 | 73 | Anyone who views this item in any way or directly or indirectly uses any script of the Script item should read this statement carefully. This warehouse reserves the right to change or supplement this disclaimer at any time. Once you have used and copied any relevant scripts or rules of the Script project, you are deemed to have accepted this disclaimer. 74 | 75 | -------------------------------------------------------------------------------- /SG.csv: -------------------------------------------------------------------------------- 1 | id,country_code,country,city,ip,host,port,supplier 2 | 2054,SG,Singapore,新加坡ViewQwest,202.83.107.134,speedtest10.vqbn.com.prod.hosts.ooklaserver.net,8080,ViewQwest 3 | 3914,SG,Singapore,新加坡RedDots,165.21.70.18,pl.speedtest.singnet.com.sg,8080,Red Dots 4 | 5935,SG,Singapore,新加坡MyRepublic,103.6.148.98,speedtest.myrepublic.com.sg.prod.hosts.ooklaserver.net,8080,MyRepublic Singapore 5 | 7311,SG,Singapore,新加坡M1Limited,103.1.138.214,m1speedtest1.m1net.com.sg,8080,M1 Limited 6 | 7556,SG,Singapore,新加坡PTFirstMedia,111.95.246.34,sg-speedtest.fast.net.id.prod.hosts.ooklaserver.net,8080,PT FirstMedia 7 | 12687,SG,Singapore,新加坡SIMBA,210.10.78.220,speedtest-sg1.simba.sg,8080,SIMBA Telecom 8 | 13058,SG,Singapore,新加坡PT.IndosatTbk,114.4.41.30,speedtest1.indosatooredoo.com.prod.hosts.ooklaserver.net,8080,PT. Indosat Tbk 9 | 13623,SG,Singapore,新加坡Singtel,165.21.70.1,speedtest.singnet.com.sg,8080,Singtel 10 | 23467,SG,Singapore,新加坡PT.ComnetsPlus,103.111.59.250,speedtest-sg.iconpln.net.id.prod.hosts.ooklaserver.net,8080,PT. Indonesia Comnets Plus 11 | 28921,SG,Singapore,新加坡PhoenixNAP,131.153.76.66,speedsin.phoenixnap.com.prod.hosts.ooklaserver.net,8080,PhoenixNAP Global IT Services 12 | 31293,SG,Singapore,新加坡PacificInternet(S),45.117.189.2,speedtest2.pacificinternet.com.prod.hosts.ooklaserver.net,8080,Pacific Internet (S) 13 | 37744,SG,Singapore,新加坡Telekomunikasi,180.240.181.36,speedtest2.telin.sg.prod.hosts.ooklaserver.net,8080,Telekomunikasi Indonesia International Pte Ltd (Telin Singapore) 14 | 41358,SG,Singapore,新加坡Contabo,103.164.55.91,sin.speedtest.contabo.net,8080,Contabo 15 | 41801,SG,Singapore,新加坡IX,103.29.57.19,speedtest-eqx-sg1.ixtelecom.net.prod.hosts.ooklaserver.net,8080,IX Telecom 16 | 42688,SG,Singapore,新加坡PTXLSMARTSejahtera,112.215.198.21,speedtest-intl.xl.co.id.prod.hosts.ooklaserver.net,8080,PT XLSMART Telecom Sejahtera 17 | 44817,SG,Singapore,新加坡SPTELPTE.LTD.,61.16.64.58,speedtest.sptel.com.prod.hosts.ooklaserver.net,8080,SPTEL PTE. LTD. 18 | 45345,SG,Singapore,新加坡MelbikomasUAB,5.44.249.3,speedtest-sin.melbicom.net,8080,Melbikomas UAB 19 | 47713,SG,Singapore,新加坡PT.MoraTelematika,202.43.176.90,sig-speedtest.moratelindo.io.prod.hosts.ooklaserver.net,8080,PT. Mora Telematika Indonesia 20 | 50406,SG,Singapore,新加坡Verizon,202.94.122.34,sgn-nperf.verizon.net.prod.hosts.ooklaserver.net,8080,Verizon 21 | 51839,SG,Singapore,新加坡GlobalXtreme,103.225.148.3,speedtest.singapore.globalxtreme.net.prod.hosts.ooklaserver.net,8080,GlobalXtreme 22 | 54359,SG,Singapore,新加坡MatrixNAPInfo,115.146.113.46,speedtest-sg.napinfo.co.id.prod.hosts.ooklaserver.net,8080,Matrix NAP Info 23 | 57570,SG,Singapore,新加坡CMC,203.171.30.20,sgpspeedtest.cmctelecom.vn.prod.hosts.ooklaserver.net,8080,CMC Telecom 24 | 59016,SG,Singapore,新加坡CBN,121.100.2.35,speedtest-sg.cbn.id,8080,CBN 25 | 62020,SG,Singapore,新加坡AxclusivePteLtd,209.146.43.37,speedtest.axclusive.com.sg.prod.hosts.ooklaserver.net,8080,Axclusive Pte Ltd 26 | 62530,SG,Singapore,新加坡SymphonyCommunicationPCL,96.30.112.242,bassoon-sg-1.violin.co.th,8080,Symphony Communication PCL 27 | 63900,SG,Singapore,新加坡PTCyber,182.23.168.253,speedtest-sg.cni.net.id,8080,PT Cyber Network Indonesia 28 | 64839,SG,Singapore,新加坡Atharva,103.176.59.15,speedtest.sin.atharva.co.id.prod.hosts.ooklaserver.net,8080,Atharva 29 | 67827,SG,Singapore,新加坡FPT,1.52.247.12,speedtestsgp.fpt.vn.prod.hosts.ooklaserver.net,8080,FPT Telecom 30 | 69764,SG,Singapore,新加坡SpaceCore.pro|PremiumVPSHosting,217.15.166.168,sg.st.spacecore.pro.prod.hosts.ooklaserver.net,8080,SpaceCore.pro | Premium VPS Hosting 31 | 69840,SG,Singapore,新加坡NearouteLimited,103.172.182.13,sg-bgp-speedtest.nearoute.io.prod.hosts.ooklaserver.net,8080,Nearoute Limited 32 | 72700,SG,Singapore,新加坡sptrnd.id,151.243.143.40,speedtest.sin.sptrnd.id,8080,sptrnd.id 33 | -------------------------------------------------------------------------------- /TW.csv: -------------------------------------------------------------------------------- 1 | id,country_code,country,city,ip,host,port,supplier 2 | 7429,TW,Taiwan,Taipei,106.105.105.66,speedtest1.taipeinet.com.tw.prod.hosts.ooklaserver.net,8080,Taipeinet 3 | 8968,TW,Taiwan,Kaohsiung,219.69.127.3,ks-speedtest.homeplus.net.tw,8080,Homeplus 4 | 11702,TW,Taiwan,Taoyuan,60.199.147.65,sptty1.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 5 | 11703,TW,Taiwan,Taipei,60.199.147.177,spttp1.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 6 | 11705,TW,Taiwan,Hsinchu,60.199.147.81,spthc1.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 7 | 11707,TW,Taiwan,Taichung,203.105.239.14,spttc2.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 8 | 11708,TW,Taiwan,Hualien,60.199.137.33,spthl1.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 9 | 11709,TW,Taiwan,Changhua,203.105.239.18,sptch2.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 10 | 11711,TW,Taiwan,Tainan,203.105.224.18,spttn2.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 11 | 11713,TW,Taiwan,Kaohsiung,203.105.224.22,sptkh2.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 12 | 12000,TW,Taiwan,Taichung,123.240.255.26,custom.tbcnet.net.tw.prod.hosts.ooklaserver.net,8080,TBC 13 | 12583,TW,Taiwan,New Taipei,60.199.137.193,sb-speedtest-1.twmbroadband.net.prod.hosts.ooklaserver.net,8080,TFN Media 14 | 13506,TW,Taiwan,Taipei,103.31.196.221,speedtest.taifo.com.tw.prod.hosts.ooklaserver.net,8080,TAIFO Taiwan 15 | 17186,TW,Taiwan,Zhongli,211.77.43.20,fetzl1.seed.net.tw.prod.hosts.ooklaserver.net,8080,FarEasTone Telecom 16 | 18445,TW,Taiwan,Taipei,111.71.227.33,tp1.chtm.hinet.net,8080,Chunghwa Mobile 17 | 18447,TW,Taiwan,New Taipei,111.71.227.41,ntp1.chtm.hinet.net,8080,Chunghwa Mobile 18 | 18450,TW,Taiwan,Hsinchu,111.71.228.41,hc1.chtm.hinet.net,8080,Chunghwa Mobile 19 | 18452,TW,Taiwan,Taoyuan,111.71.228.33,ty1.chtm.hinet.net,8080,Chunghwa Mobile 20 | 18456,TW,Taiwan,Taichung,111.71.229.33,tc1.chtm.hinet.net,8080,Chunghwa Mobile 21 | 18458,TW,Taiwan,Kaohsiung,111.71.230.33,kh1.chtm.hinet.net,8080,Chunghwa Mobile 22 | 18475,TW,Taiwan,Keelung,210.61.132.22,klv3-1.speedtest.idv.tw,8080,Chief Telecom 23 | 18478,TW,Taiwan,Douliu,210.61.132.30,dlv3-1.speedtest.idv.tw,8080,Chief Telecom 24 | 18480,TW,Taiwan,Taitung,210.61.132.38,ttv3-1.speedtest.idv.tw,8080,Chief Telecom 25 | 18607,TW,Taiwan,Tainan,111.71.230.41,tn1.chtm.hinet.net,8080,Chunghwa Mobile 26 | 18611,TW,Taiwan,Changhua,111.71.229.41,ch1.chtm.hinet.net,8080,Chunghwa Mobile 27 | 24377,TW,Taiwan,Tainan,115.43.192.133,tn-speedtest.homeplus.net.tw,8080,Homeplus 28 | 24460,TW,Taiwan,New Taipei,115.43.128.130,ntp-speedtest.homeplus.net.tw,8080,Homeplus 29 | 24461,TW,Taiwan,Banqiao,219.68.164.18,sky-speedtest.homeplus.net.tw,8080,Homeplus 30 | 24462,TW,Taiwan,Taoyuan,115.43.176.10,ty-speedtest.homeplus.net.tw,8080,Homeplus 31 | 24974,TW,Taiwan,Keelung,115.43.96.15,kl-speedtest.homeplus.net.tw,8080,Homeplus 32 | 29253,TW,Taiwan,Kaohsiung Lingya,203.187.94.4,gd-speedtest.homeplus.net.tw,8080,Homeplus 33 | 29283,TW,Taiwan,Shulin District,203.187.90.4,gh-speedtest.homeplus.net.tw,8080,Homeplus 34 | 29284,TW,Taiwan,Tainan South District,203.187.93.4,sc-speedtest.homeplus.net.tw,8080,Homeplus 35 | 29288,TW,Taiwan,Daan District,203.187.82.4,wd-speedtest.homeplus.net.tw,8080,Homeplus 36 | 30916,TW,Brazil,Formosa,131.0.56.5,speedtest.plugfibra.com.br.prod.hosts.ooklaserver.net,8080,Plug Fibra 37 | 31648,TW,Taiwan,New Taipei,211.23.170.146,speedtest.sercomm.com,8080,Sercomm Corporation 38 | 31940,TW,Brazil,Formosa,45.186.64.9,speed.powerconnect.net.br,8080,Power Connect 39 | 32319,TW,Taiwan,Tainan,120.116.1.43,tnookla.tn.edu.tw,8080,TNIC 40 | 36071,TW,Taiwan,Taipei,103.246.219.98,speedtest.imcloud.tw.prod.hosts.ooklaserver.net,8080,"Sky Digital Co., Ltd" 41 | 36122,TW,Taiwan,Tainan,123.205.190.221,speedtestookla.hya.tw.prod.hosts.ooklaserver.net,8080,HYA 42 | 40727,TW,Taiwan,Taichung,211.77.43.115,seednet-tc1.seed.net.tw.prod.hosts.ooklaserver.net,8080,SEEDNET 43 | 40742,TW,Argentina,Formosa,45.175.140.18,speedtest.bocarojasa.com.ar.prod.hosts.ooklaserver.net,8080,Boca Roja SA 44 | 41191,TW,Taiwan,Chiayi,203.105.224.14,sptcy2.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 45 | 42192,TW,Taiwan,New Taipei,103.129.168.8,speedtest.host.com.tw.prod.hosts.ooklaserver.net,8080,Yuan-Jhen Info 46 | 44603,TW,Taiwan,Taipei,103.147.22.134,speedtest.twds.com.tw.prod.hosts.ooklaserver.net,8080,Taiwan Digital Streaming Co. 47 | 47427,TW,Brazil,Formosa,177.73.88.4,speedtest.netviatelecom.com.br,8080,Netvia 48 | 56277,TW,Taiwan,Miaoli City,203.105.239.22,sptdl2.taiwanmobile.com.prod.hosts.ooklaserver.net,8080,Taiwan Mobile 49 | 59180,TW,Taiwan,Taipei City,103.186.118.247,ookla-speedtest.starverse.network.prod.hosts.ooklaserver.net,8080,Starverse Network 50 | 61136,TW,Taiwan,Taipei,211.76.176.11,tpe.speedtest.pni.tw.prod.hosts.ooklaserver.net,8080,"Pittqiao Network Information Co.,Ltd." 51 | 61560,TW,Taiwan,Taichung,103.127.218.248,tcg.speedtest.pni.tw.prod.hosts.ooklaserver.net,8080,"Pittqiao Network Information Co.,Ltd." 52 | 65092,TW,Taiwan,Taipei,206.148.22.75,tpe.speedtest.gslnetworks.com.prod.hosts.ooklaserver.net,8080,GSL Networks 53 | 71305,TW,Brazil,Formosa,38.226.107.72,teste.unifibranet.com.br,8080,UNI FIBRANET 54 | 72390,TW,Taiwan,Taipei,160.30.99.46,speedtest.lazco.dev,8080,LAZCO STUDIO LTD 55 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import re 2 | import csv 3 | import json 4 | import urllib.request 5 | import time 6 | from pypinyin import lazy_pinyin 7 | 8 | def contain_chinese(string): 9 | pattern = re.compile("[\u4e00-\u9fa5]+") 10 | match = pattern.search(string) 11 | return match is not None 12 | 13 | def get_pingyin(string): 14 | return ''.join(lazy_pinyin(string)).lower() 15 | 16 | def replace_all(string): 17 | replacements = {".net": "", ".com": "", ", Inc.": "", "China Mobile ": "", "Network": "", "Networks": "", 18 | "Network": "", " Telecom": "", "Hong Kong": "", ".jp": "", "Capital Corporation": "", 19 | "Corporation": "", "Japan": "", "International Pte Ltd (Telin Singapore)": "", 20 | "Singapore": "", "Global Ltd": "", "Capital Corp.": "", "Global IT Services": "", 21 | "Indonesia": "", " PCL.": "", " ": ""} 22 | for old, new in replacements.items(): 23 | string = string.replace(old, new) 24 | return string 25 | 26 | # IP地址归属地查询API的URL 27 | url_template = 'http://ip-api.com/json/{ip}?lang=zh-CN' 28 | 29 | # 三个运营商的关键词 30 | unicom_keywords = ['China Unicom', 'CHINA169', 'CNCNET', 'Provincial Net of CU', 'UNICOM'] 31 | mobile_keywords = ['China Mobile', 'Provincial Net of CM', 'MOBILE'] 32 | telecom_keywords = ['China Telecom', 'China Tietong', 'Chinanet', 'TieTong', 'Provincial Net of CT', 'TELECOM'] 33 | 34 | # 打开CSV文件 35 | with open('CN.csv', 'r', encoding='utf-8') as csvfile: 36 | reader = csv.reader(csvfile) 37 | # 跳过第一行,因为是标题 38 | next(reader) 39 | # 创建三个CSV文件,用于存储三个运营商的行 40 | unicom_file = open('CN_Unicom.csv', 'w', encoding='utf-8', newline='') 41 | mobile_file = open('CN_Mobile.csv', 'w', encoding='utf-8', newline='') 42 | telecom_file = open('CN_Telecom.csv', 'w', encoding='utf-8', newline='') 43 | unicom_writer = csv.writer(unicom_file) 44 | mobile_writer = csv.writer(mobile_file) 45 | telecom_writer = csv.writer(telecom_file) 46 | # 依次读取每一行,并查询所属运营商 47 | for row in reader: 48 | ip = row[4] # IP地址所在的列为第5列,下标为4 49 | name = row[7] 50 | url = url_template.format(ip=ip) 51 | with urllib.request.urlopen(url) as response: 52 | data = response.read().decode('utf-8') 53 | data = json.loads(data) 54 | if data['status'] == 'success': 55 | city = data['city'] 56 | time.sleep(1) 57 | if contain_chinese(name) == True: 58 | row[3] = name.replace("电信", "").replace("移动", "").replace("联通", "") 59 | else: 60 | if contain_chinese(row[3]) == True: 61 | pass 62 | else: 63 | city = city.replace("市", "") 64 | city_pingyin = get_pingyin(city) 65 | if city_pingyin == row[3].replace("'","").replace(" ","").lower(): 66 | row[3] = city 67 | if "5G" in name and "5G" not in row[3]: 68 | row[3] += "5G" 69 | if data['status'] == 'success': 70 | isp = data['isp'] 71 | # 判断所属运营商 72 | if any(keyword in isp for keyword in unicom_keywords): 73 | if row[1] == "CN": 74 | # print(row) 75 | unicom_writer.writerow(row) 76 | elif any(keyword in isp for keyword in mobile_keywords): 77 | if row[1] == "CN": 78 | mobile_writer.writerow(row) 79 | elif any(keyword in isp for keyword in telecom_keywords): 80 | if row[1] == "CN": 81 | telecom_writer.writerow(row) 82 | else: 83 | print(isp) 84 | # 关闭文件 85 | unicom_file.close() 86 | mobile_file.close() 87 | telecom_file.close() 88 | 89 | # HK文件处理 90 | with open('HK.csv', 'r') as file: 91 | reader = csv.reader(file) 92 | data = [row for row in reader] 93 | 94 | for row in data: 95 | if row[3] == "city": 96 | continue 97 | if row[2] != "Hong Kong": 98 | row[2] = "HongKong" 99 | if row[3] != 'Hong Kong': 100 | row[3] = "香港HongKong" 101 | if len(replace_all(row[7])) <= 11: 102 | row[3] = "香港" + replace_all(row[7]) 103 | elif row[3] == 'Hong Kong': 104 | row[3] = "香港HongKong" 105 | 106 | with open('HK.csv', 'w', newline='') as file: 107 | writer = csv.writer(file) 108 | writer.writerows(data) 109 | 110 | # JP文件处理 111 | with open('JP.csv', 'r') as file: 112 | reader = csv.reader(file) 113 | data = [row for row in reader] 114 | 115 | for row in data: 116 | if row[3] == "city": 117 | continue 118 | if row[2] != "Japan": 119 | row[2] = "Japan" 120 | if row[3] == 'Tokyo': 121 | row[3] = "东京"+replace_all(row[7]) 122 | elif row[3] == 'Kochi': 123 | row[3] = "高知"+replace_all(row[7]) 124 | elif row[3] == 'Okinawa': 125 | row[3] = "冲绳"+replace_all(row[7]) 126 | else: 127 | row[3] = "日本"+row[3] 128 | 129 | with open('JP.csv', 'w', newline='') as file: 130 | writer = csv.writer(file) 131 | writer.writerows(data) 132 | 133 | # SG文件处理 134 | with open('SG.csv', 'r') as file: 135 | reader = csv.reader(file) 136 | data = [row for row in reader] 137 | 138 | for row in data: 139 | if row[3] == "city": 140 | continue 141 | if row[2] != "Singapore": 142 | row[2] = "Singapore" 143 | if row[3] == 'Singapore': 144 | row[3] = "新加坡"+replace_all(row[7]) 145 | 146 | with open('SG.csv', 'w', newline='') as file: 147 | writer = csv.writer(file) 148 | writer.writerows(data) 149 | 150 | # ls_sg_hk_jp.csv 文件处理 151 | with open('ls_sg_hk_jp.csv', 'r') as file: 152 | reader = csv.reader(file) 153 | rows = list(reader) 154 | rows[1][3] = '洛杉矶' 155 | rows[2][3] = '法兰克福' 156 | rows[3][3] = '新加坡' 157 | rows[4][3] = '中国香港' 158 | rows[5][3] = '日本东京' 159 | with open('ls_sg_hk_jp.csv', 'w', newline='') as file: 160 | writer = csv.writer(file) 161 | writer.writerows(rows) 162 | --------------------------------------------------------------------------------