-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetFrame.py
11 lines (7 loc) · 2.09 KB
/
getFrame.py
1
2
3
4
5
6
7
8
9
10
11
import requests
import subprocess
channel = 'tsm_dyrus'
r = requests.get('http://usher.justin.tv/find/%s.json?type=any' % (channel))
result = r.json()[0]
command = 'rtmpdump --swfUrl http://www.justin.tv/widgets/live_embed_player.swf --jtv \'%s\' --live -r %s/%s --stop 1 | avconv -i - -s 1920x1080 -vframes 1 file.png' % (result['token'], result['connect'], result['play'])
subprocess.call(command, shell=True)