Download on demand

Delete only when files are corrupted
Download only when a new version of a file is available
close #39
This commit is contained in:
Howard20181 2022-08-26 02:33:27 +08:00
parent cd138840d8
commit f6a348a596
5 changed files with 98 additions and 67 deletions

View file

@ -50,12 +50,8 @@ except Exception:
print(f"download link: {link}", flush=True)
out_file = download_dir / "gapps.zip"
if not os.path.isfile(out_file):
# urllib.request.urlretrieve(link, out_file)
with open(download_dir/tempScript, 'a') as f:
f.writelines(f'{link}\n')
f.writelines(f' dir={download_dir}\n')
f.writelines(f' out=gapps.zip\n')
f.close
with open(download_dir/tempScript, 'a') as f:
f.writelines(f'{link}\n')
f.writelines(f' dir={download_dir}\n')
f.writelines(f' out=OpenGApps-{arch}-{variant}.zip\n')
f.close