Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- import requests, enlighten
- import os
- def downdisc():
- url = 'https://discord.com/api/downloads/distributions/app/installers/latest?channel=stable&platform=win&arch=x86'
- fname = 'DiscordSetup.exe'
- # Should be one global variable
- MANAGER = enlighten.get_manager()
- r = requests.get(url, stream = True)
- dlen = int(r.headers.get('Content-Length', '0')) or None
- with MANAGER.counter(color = 'green', total = dlen and math.ceil(dlen / 2 ** 20), unit = 'MiB', leave = False) as ctr, \
- open(fname, 'wb', buffering = 2 ** 24) as f:
- for chunk in r.iter_content(chunk_size = 2 ** 20):
- f.write(chunk)
- ctr.update()
- def downsteam():
- url = 'https://cdn.akamai.steamstatic.com/client/installer/SteamSetup.exe'
- fname = 'SteamSetup.exe'
- # Should be one global variable
- MANAGER = enlighten.get_manager()
- r = requests.get(url, stream = True)
- dlen = int(r.headers.get('Content-Length', '0')) or None
- with MANAGER.counter(color = 'green', total = dlen and math.ceil(dlen / 2 ** 20), unit = 'MiB', leave = False) as ctr, \
- open(fname, 'wb', buffering = 2 ** 24) as f:
- for chunk in r.iter_content(chunk_size = 2 ** 20):
- f.write(chunk)
- ctr.update()
- def downLogitech():
- url = 'https://download01.logi.com/web/ftp/pub/techsupport/gaming/lghub_installer.exe'
- fname = 'lghub_installer.exe'
- # Should be one global variable
- MANAGER = enlighten.get_manager()
- r = requests.get(url, stream = True)
- dlen = int(r.headers.get('Content-Length', '0')) or None
- with MANAGER.counter(color = 'green', total = dlen and math.ceil(dlen / 2 ** 20), unit = 'MiB', leave = False) as ctr, \
- open(fname, 'wb', buffering = 2 ** 24) as f:
- for chunk in r.iter_content(chunk_size = 2 ** 20):
- f.write(chunk)
- ctr.update()
- def downepic():
- url = 'https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi?trackingId=034d2b021b8e4bd6ac0c0ae3c56c6d3e'
- fname = 'EpicInstaller-13.0.0-034d2b021b8e4bd6ac0c0ae3c56c6d3e.msi'
- # Should be one global variable
- MANAGER = enlighten.get_manager()
- r = requests.get(url, stream = True)
- dlen = int(r.headers.get('Content-Length', '0')) or None
- with MANAGER.counter(color = 'green', total = dlen and math.ceil(dlen / 2 ** 20), unit = 'MiB', leave = False) as ctr, \
- open(fname, 'wb', buffering = 2 ** 24) as f:
- for chunk in r.iter_content(chunk_size = 2 ** 20):
- f.write(chunk)
- ctr.update()
- a = input("What would you like to download:\nEpic games (1)\nSteam (2)\nDiscord (3)\nLogitechHub (4)\nAll (5)\n")
- answer = int(a)
- if answer == 1:
- downepic()
- elif answer == 2:
- downsteam()
- elif answer == 3:
- downdisc()
- elif answer == 4:
- downLogitech()
- elif answer == 5:
- downepic()
- downsteam()
- downdisc()
- downLogitech()
- os.system("pause")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement