import requests
headers = {'Authorization': 'Bearer 5egdrak4zcq1zx3eo6ew5o1chyxxo4'}
r = requests.get('https://api.twitch.tv/helix/analytics/extensions?first=5', headers=headers, stream=True)
with open('test.html', 'w') as output_file:
output_file.write(r.text)