Compare commits
2 Commits
dadaed4288
...
5f595d2955
Author | SHA1 | Date |
---|---|---|
John Smith | 5f595d2955 | 1 day ago |
John Smith | 57676caa90 | 1 day ago |
4 changed files with 188 additions and 32 deletions
@ -0,0 +1,94 @@
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env python3 |
||||
# This file is a part of speedtest |
||||
# Created at 01/17/2025 |
||||
|
||||
import os |
||||
import sys |
||||
|
||||
core = getattr(sys.modules["__main__"], "__file__", None) |
||||
if core: |
||||
core = os.path.abspath(core) |
||||
root = os.path.dirname(core) |
||||
if root: |
||||
os.chdir(root) |
||||
|
||||
|
||||
import requests |
||||
|
||||
URLS_FILE = "urls.txt" |
||||
|
||||
SEARCH_STRINGS = ["azurespeed.com", "windows.net", "azure"] |
||||
|
||||
BASE_URL = "https://www.azurespeed.com/api/sas?regionName={location}&blobName=100MB.bin&operation=download" |
||||
|
||||
LOCATIONS = ("australiacentral", |
||||
"australiaeast", |
||||
"australiasoutheast", |
||||
"centralindia", |
||||
"eastasia", |
||||
"japaneast", |
||||
"japanwest", |
||||
"koreacentral", |
||||
"koreasouth", |
||||
"newzealandnorth", |
||||
"southindia", |
||||
"southeastasia", |
||||
"westindia") |
||||
|
||||
|
||||
DIRECTIONS = ("southeast", "west", "south", "central", "east", "north") |
||||
|
||||
|
||||
def convert_location(location: str) -> str: |
||||
for direction in DIRECTIONS: |
||||
if direction in location: |
||||
location = location.replace(direction, "") |
||||
location = direction.capitalize() + " " + location.capitalize() |
||||
break |
||||
return location |
||||
|
||||
|
||||
def get_urls() -> list[tuple[str]]: |
||||
new_urls = [] |
||||
for location in LOCATIONS: |
||||
url = BASE_URL.format(location=location) |
||||
try: |
||||
json = requests.get(url).json() |
||||
new_url = json["url"] |
||||
except Exception: |
||||
continue |
||||
new_urls.append((location, new_url)) |
||||
return new_urls |
||||
|
||||
|
||||
def rewrite_urls(new_urls: list[tuple[str]]): |
||||
contents = [] |
||||
with open(URLS_FILE, "r") as file: |
||||
for line in file.read().splitlines(): |
||||
line = line.strip() |
||||
for str_ in SEARCH_STRINGS: |
||||
if str_.lower() in line.lower(): |
||||
break |
||||
else: |
||||
contents.append(line) |
||||
|
||||
with open(URLS_FILE, "w") as file: |
||||
for (location, new_url) in new_urls: |
||||
location = convert_location(location) |
||||
file.write("{location}|Azure|{new_url}\n".format(location=location, new_url=new_url)) |
||||
for item in contents: |
||||
file.write(item + "\n") |
||||
|
||||
|
||||
|
||||
def update_azure_lists(): |
||||
urls = get_urls() |
||||
rewrite_urls(urls) |
||||
|
||||
|
||||
def main(): |
||||
update_azure_lists() |
||||
|
||||
|
||||
if __name__ == "__main__": |
||||
main() |
@ -1 +1,30 @@
@@ -1 +1,30 @@
|
||||
http://ipv4.download.thinkbroadband.com/100MB.zip |
||||
Asia|Azure|https://s9eastasia.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A57Z&se=2025-01-17T15%3A45%3A57Z&sr=b&sp=rl&sig=9FV1YZ8Hhz%2FqPh7hUSxGjSepyQsAZBv8DYJAcqqEjFI%3D |
||||
Asia|Azure|https://s9southeastasia.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A26%3A02Z&se=2025-01-17T15%3A46%3A02Z&sr=b&sp=rl&sig=nc9%2B%2FF8gQGmcEAQ5Z4K2uNkYMWkPivVlzgoIyZGLy3Y%3D |
||||
Australia|Azure|https://s9australiacentral.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A54Z&se=2025-01-17T15%3A45%3A54Z&sr=b&sp=rl&sig=bLrs1P6U6n4NOf3zSZ9sWdTeR5sIFFOAksHtWUNozFY%3D |
||||
Australia|Azure|https://s9australiaeast.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A55Z&se=2025-01-17T15%3A45%3A55Z&sr=b&sp=rl&sig=gzrNuG0bDGo%2BuysGrF1l6jykjkvLTDWWLBIFka2i%2F5g%3D |
||||
Australia|Azure|https://s9australiasoutheast.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A56Z&se=2025-01-17T15%3A45%3A56Z&sr=b&sp=rl&sig=IaryQBfHN0GDbI6NDcLRbCZixCDv7fwsK%2FpaE9IdwoQ%3D |
||||
Australia|DataPacket|http://syd.download.datapacket.com/100mb.bin |
||||
China|Alibaba Cloud|http://oss-cn-hangzhou.aliyuncs.com/100mb.test |
||||
Hong Kong|ChinaHoster|http://www.chinahoster.com/speedtest/100MB.bin |
||||
Hong Kong|DataPacket|http://hkg.download.datapacket.com/100mb.bin |
||||
Hong Kong|DataPacket|https://www.datapacket.com/speed-test-files/asia-pacific/100MB-test.bin |
||||
India|Azure|https://s9centralindia.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A56Z&se=2025-01-17T15%3A45%3A56Z&sr=b&sp=rl&sig=i5EAszwlB8s7m5RY2JpNujZPT6YE9VHdkV1EJWCMAUg%3D |
||||
India|Azure|https://s9southindia.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A26%3A01Z&se=2025-01-17T15%3A46%3A01Z&sr=b&sp=rl&sig=bzg8b24Y9K8fC6PAMfmZITe4cIM9tgKLy3oBLgMxo2Y%3D |
||||
India|Azure|https://s9westindia.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A26%3A02Z&se=2025-01-17T15%3A46%3A02Z&sr=b&sp=rl&sig=FA1WwAKxeRSI%2Bxxyj9PZXvTQSqeBQ1uAl4B7pTCKetU%3D |
||||
India|HostDime|http://lg.india.hostdime.com/100MB.test |
||||
Indonesia|IDCloudHost|http://speedtest.idcloudhost.com/100MB.bin |
||||
Japan|Azure|https://s9japaneast.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A58Z&se=2025-01-17T15%3A45%3A58Z&sr=b&sp=rl&sig=%2BFszXPqik4IUIYQMVCWN5nCaw4zqQcZww7pZEagUyRE%3D |
||||
Japan|Azure|https://s9japanwest.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A58Z&se=2025-01-17T15%3A45%3A58Z&sr=b&sp=rl&sig=LbR%2Bj3ympdASZeSHP6xzB7fIhSz7hTcSPfcYltuw9J4%3D |
||||
Japan|DataPacket|http://tyo.download.datapacket.com/100mb.bin |
||||
Japan|VPSServer|https://tok.vpsserver.com/speedtest/100mb.bin |
||||
Japan|Vultr|https://hnd-jp-ping.vultr.com/vultr.com.100MB.bin |
||||
Korea|Azure|https://s9koreacentral.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A25%3A59Z&se=2025-01-17T15%3A45%3A59Z&sr=b&sp=rl&sig=eKnElmAfzFNdXr27LS4RNGbTY3tuq1uW%2F3ezjp4Z1FU%3D |
||||
Korea|Azure|https://s9koreasouth.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A26%3A00Z&se=2025-01-17T15%3A46%3A00Z&sr=b&sp=rl&sig=R8wZYDuGazDZK5GJhQgjzypzK5dXBb%2BJmJ2FKGGL1ow%3D |
||||
Newzealand|Azure|https://s9newzealandnorth.blob.core.windows.net/private/100MB.bin?sv=2025-01-05&st=2025-01-17T15%3A26%3A00Z&se=2025-01-17T15%3A46%3A00Z&sr=b&sp=rl&sig=99bmn5fXk9rkWZndCI6PkkGAanczUVaKuCKtyOAB8JM%3D |
||||
Singapore|DataPacket|http://sgp.download.datapacket.com/100mb.bin |
||||
Singapore|OneAsiaHost|http://speedtest.oneasiahost.com/100mb.bin |
||||
Singapore|OVH|https://sgp.proof.ovh.net/files/100Mb.dat |
||||
Singapore|Vultr|https://sgp-ping.vultr.com/vultr.com.100MB.bin |
||||
South Korea|KT|http://kt-speedtest.apis.sktelecom.com/100MB.bin |
||||
Taiwan|Chunghwa Telecom|http://speedtest.cht.com.tw/100MB.bin |
||||
Thailand|Bangmod Cloud|http://lg.bangmod.cloud/100MB.test |
||||
|
Loading…
Reference in new issue