Skip to content

Instantly share code, notes, and snippets.

@allieus
Created September 29, 2020 06:13
Show Gist options
  • Save allieus/329cde52b8c494c38fa9f05580102751 to your computer and use it in GitHub Desktop.
Save allieus/329cde52b8c494c38fa9f05580102751 to your computer and use it in GitHub Desktop.
Ignite2020 SessionDownloader (Python)
from pprint import pprint
from tqdm import tqdm
import requests
print('Loading session list ...')
res = requests.get('https://api.myignite.microsoft.com/api/session/all')
res.raise_for_status()
session_list = res.json()
print(f'Try {len(session_list)} videos ...')
for session in tqdm(session_list):
title = session['title']
filename = f'{title}.mp4'
url = session['downloadVideoLink']
if not url:
continue
res = requests.get(url)
res.raise_for_status()
with open(filename, 'wb') as f:
for chunk in res.iter_content(chunk_size=8192):
f.write(chunk)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment