Last active
February 11, 2026 07:42
-
-
Save jossef/4b4fe99155b9bfe84275 to your computer and use it in GitHub Desktop.
vorpx (oculus VR enhancements) last version download script
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
| import socket | |
| def download_file_oldschool(host, page, output_file, headers={}): | |
| request = 'GET {page} HTTP/1.1\r\nHost: {host}'.format(page=page, host=host) | |
| for name, value in headers.iteritems(): | |
| request += '\r\n{name}: {value}'.format(name=name, value=value) | |
| request += '\r\n\r\n' | |
| try: | |
| s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
| s.connect((host, 80)) | |
| s.send(request) | |
| with open(output_file, 'wb') as f: | |
| parsed_headers = False | |
| remaining = 0 | |
| while True: | |
| data = s.recv(1360) | |
| if not data: | |
| break | |
| if not parsed_headers and '\n\n' in data: | |
| split = data.split('\r\n\r\n') | |
| headers = split[0] | |
| data = split[1] | |
| for line in headers.split('\r\n'): | |
| if line.lower().startswith('content-length'): | |
| content_length = line.split(':')[1].strip() | |
| remaining = int (content_length) | |
| parsed_headers = True | |
| f.write(data) | |
| remaining -= len(data) | |
| print 'remaining', remaining | |
| if remaining <= 0: | |
| break | |
| finally: | |
| s.close() | |
| host = "www.vorpx.com" | |
| page = '/v0/latest/vorpX_Setup.ex_' | |
| output_file = 'vorpx-installer.exe' | |
| headers = {'Authorization' : 'Basic d2Vic2V0dXA6d2ViIzI3NjkyMzcqc2V0dXA='} | |
| download_file_oldschool(host, page, output_file, headers) | |
| print "done" |
stevefan1999
commented
Nov 19, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment