Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion download-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
'''

def fetch_data(api_path, slug):
with urllib.request.urlopen(f'{CONDUIT_API_URL}{api_path}{slug}') as response:
url = f'{CONDUIT_API_URL}{api_path}{slug}'
req = urllib.request.Request(
url,
headers={'User-Agent': 'Mozilla/5.0'}) # request is blocked with 403 unless specifying user agent
with urllib.request.urlopen(req) as response:
return response.read()

parser = argparse.ArgumentParser(description='Download Conduit Configs')
Expand Down