Created
August 10, 2020 06:54
-
-
Save gh-doot/ce8bc8a22d54897fdad75797af66c725 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from win10toast import ToastNotifier | |
from tqdm import tqdm | |
import requests | |
reposowner = input("Repository owner's name! CaSe SeNsItIvE") | |
reposname = input("Repository's name! CaSe SeNsItIvE") | |
mute = input("Do you want to enable notifications or not? (Y/N(CaSe SeNsItIvE))") | |
chunk_size = 1024 | |
url = "github.com/" + reposowner + "/" + reposname + "/archive/master.zip" | |
r = requests.get(url, stream = True) | |
total_size = int(r.headers['content-length']) | |
filename = url.split('/')[-1] | |
with open(filename, 'wb') as f: | |
for data in tqdm(iterable = r.iter_content(chunk_size = chunk_size), total = total_size/chunk_size, unit = 'KB'): | |
f.write(data) | |
print("Download complete!") | |
if mute == "Y": | |
ToastNotifier().show_toast("PyStore", filename + " got installed! Take a look!") | |
elif mute == "N": | |
pass | |
else: | |
ToastNotifier().show_toast("PyStore", filename + " got installed! Take a look! (NOTICE: The notification was made because you did the Y/N question incorrectly!)") | |
# =====================================================START OF NOTICE!============================================================ | |
# THIS IS NOT INTENDED FOR GITHUB DEPLOYERS!(etc. Heroku) | |
# THIS WILL MALFUNCTION THE PYTHON CODE, Thus, NO OUTPUT! | |
# THIS WILL BE LATER ON FIXED! | |
# ALSO. CREDITS TO THOSE WHO MADE THE PACKAGES, AND THE CREATOR OF PYTHON, ALSO REMEMBER I MADE THIS | |
# ORIGINAL IDEA WAS FROM: https://gist.github.com/nikhilkumarsingh/d29c1fdec0f4e266e53137d96b52e289#file-file_downloader-py | |
# I PREFFERED TO DO IT BECAUSE: https://gist.github.com/nikhilkumarsingh/d29c1fdec0f4e266e53137d96b52e289#gistcomment-3402388 | |
# ALSO THE DOWNLOAD DEPENDS ON YOUR BANDWIDTH, DO NOT ARGUE ABOUT WHY IT TAKES SO LONG, ALSO, SOME OF THESE THINGS ARE MADE BY ME! | |
# SO PLEASE CREDIT ME, IT IS APPRECIATED! ALSO CREDITING THE CREATOR OF PYTHON AND PACKAGES ARE VERY IMPORANT, BECAUSE THEN THEY WILL THINK YOU ARE THE CREATOR, THUS, BEING REPORTED! | |
# IF I FIND AN VIDEO USING MY CODE. I WILL REPORT IT IF APPLICABLE! | |
# THANKS FOR READING THIS! | |
# ======================================================END OF NOTICE!============================================================= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment