Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- import os
- path = os.getcwd() + '\\Shlorox\\'
- os.makedirs(path, exist_ok=True)
- start_at = 0
- with open('clips.json', encoding='utf-8') as f:
- data = json.load(f)
- data = data[start_at:]
- for i, val in enumerate(data):
- print('Getting: {} - Views: {} - Clips remaining: {}'. format(val['name'], val['views'], len(data) - i))
- try:
- r = requests.get(val['data_url'], allow_redirects=False)
- with open(path + str(i + start_at) + '_' + val['name'] + ' - (' + val['views'] + ').mp4', 'wb') as mp4_file:
- mp4_file.write(r.content)
- except KeyError:
- print(' no clip url found :(')
Add Comment
Please, Sign In to add comment