Last active
February 13, 2019 17:06
-
-
Save Justsoos/b15aece4dc80c5b2c680e0f5df264d48 to your computer and use it in GitHub Desktop.
USAGE: python douyu_curl.py "copy as curl" >>> GET THE URL 已作废
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import sys | |
import json | |
import re | |
import subprocess | |
t = sys.argv | |
t = [i.replace('^','') for i in t] #for chrome bad escape character | |
t = [re.sub(r'rate=([0-9])','0',i) for i in t] #only show original resolution | |
del t[0] | |
t[0]= ['curl -s'] | |
api_r = subprocess.check_output(t,universal_newlines=True) | |
s = json.loads(api_r)['data'] | |
rtmp_url = s['rtmp_url'] | |
rtmp_live = s['rtmp_live'] | |
e = rtmp_url + '/' + rtmp_live | |
print(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
具体参考这里:rosynirvana/douyu_cli#4 (comment)