from pathlib import Path
import urllib.request,concurrent.futures,zipfile
p=Path(r'G:\app vcam\tools');p.mkdir(exist_ok=True)
urls={'jdk.zip':'https://aka.ms/download-jdk/microsoft-jdk-17.0.18-windows-x64.zip','cmdline.zip':'https://dl.google.com/android/repository/commandlinetools-win-11076708_latest.zip','platform-tools.zip':'https://dl.google.com/android/repository/platform-tools-latest-windows.zip'}
def get(k,u):
 print('download',k,flush=True);urllib.request.urlretrieve(u,p/k);zipfile.ZipFile(p/k).extractall(p/k.removesuffix('.zip'));print('ready',k,flush=True)
with concurrent.futures.ThreadPoolExecutor() as x:list(x.map(lambda kv:get(*kv),urls.items()))
