Skip to content

Instantly share code, notes, and snippets.

@Jan200101
Last active June 30, 2017 22:01
Show Gist options
  • Save Jan200101/868ad51950f3c3b35081ef9acf19dc80 to your computer and use it in GitHub Desktop.
Save Jan200101/868ad51950f3c3b35081ef9acf19dc80 to your computer and use it in GitHub Desktop.
import sys
import time
import random
import os
import hashlib
if __name__ == '__main__':
args = sys.argv
if not args[1:]:
args = ['',input('Input game to download\n>')]
game = " ".join(args[1:])
game = game.lower().encode('utf-8')
hash = list(hashlib.md5(game).hexdigest())
hashnum = 0
hashstr = []
for x in hash:
if x.isdigit():
hashnum += int(x)
hashstr.append(x)
hashnum = hashnum - (hashnum / len(hashstr))- 25
hashnum = int(str(hashnum).split('.')[0])
print('Downloading \'{}\' is that correct? (yes/no)'.format(game.decode('utf-8') ))
prompt = input('>')
if not prompt:
print('Exiting...')
if prompt.lower() != 'yes':
print('Exiting...')
else:
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
print('Connecting to BShop database...')
time.sleep(random.randint(3,13))
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
print('Starting Download...')
time.sleep(5)
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
for x in range(0, hashnum):
latest = int(str((100 / hashnum )* x).split('.')[0])
message = ' Download Status:\n <' + latest * '■' + (hashnum - latest) * ' ' + '>'
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
print(message)
time.sleep(random.randint(10,25))
print('<')
time.sleep(5)
print('Done')
if os.name == 'nt':
print('Your game has been saved under \'C:\\Windows\\System32\'')
else:
print('Your game has been saved under \'/etc/bin\'')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment