Create a gist now

Instantly share code, notes, and snippets.

@miettal /
Last active Feb 28, 2018

What would you like to do?
#!/usr/bin/env python
# coding:utf-8
from pprint import pprint as pp
import requests
import json
url = ""
movie_url = "{:s}"
f = open('', 'w')
r = requests.get(url);
obj1 = json.loads(r.text)
for collectionRefList in obj1['collectionRefList'] :
for merchandisedOrder in collectionRefList['merchandisedOrder'] :
r = requests.get(movie_url.format(merchandisedOrder))
obj2 = json.loads(r.text)
main_title = obj2['title']
for video in obj2['videos'] :
sub_title = video['subTitleLanguages']
src = video['src']
if sub_title is None :
filename = "{:s}.mp4".format(main_title.encode('utf-8'))
else :
filename = "{:s}-{:s}.mp4".format(main_title.encode('utf-8'), sub_title.encode('utf-8'))
f.write('curl {:s} > "{:s}"\n'.format(src, filename))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment