Skip to content

Instantly share code, notes, and snippets.

@crorella
Created April 21, 2017 17:50
Show Gist options
  • Select an option

  • Save crorella/32a4ca7b7539b371e23a4b1ca245b2aa to your computer and use it in GitHub Desktop.

Select an option

Save crorella/32a4ca7b7539b371e23a4b1ca245b2aa to your computer and use it in GitHub Desktop.
import os
import requests
url = 'http://54.202.193.48/upload'
headers = {}
for root, dirs, files in os.walk("PATH TO YOUR REPLAY FOLDER", topdown=False):
for name in files:
if name.endswith('StormReplay'):
path = os.path.join(root, name)
files = {'replay': open(path, 'rb')}
res = requests.post(url, files=files, headers=headers)
print res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment