little changes

This commit is contained in:
2022-11-12 19:24:38 +02:00
parent 4e8ecce090
commit 189ffd55d2

View File

@@ -13,19 +13,19 @@ def get_all_urls_packages():
return list(dict.fromkeys(findall("https://.+.tgz", content)))
def download_npm_package(url:str, path="./"):
def download_npm_package(url:str, dir="npm-packages"):
try:
mkdir(path)
mkdir(dir)
except:
pass
with open(path + url.split("/")[-1], "wb") as npm_package_file:
with open(dir + "/" + url.split("/")[-1], "wb") as npm_package_file:
npm_package_file.write(requests.get(url))
def download_all_package():
packages_urls = get_all_urls_packages()
for package_url in packages_urls:
download_npm_package(package_url, "npm-packages/")
download_npm_package(package_url, "npm-packages")
def main():