Created
March 4, 2017 04:54
-
-
Save spacemeowx2/629b1d131bd7e240a7d28742048e80fc to your computer and use it in GitHub Desktop.
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
import requests | |
import time | |
from hashlib import md5 | |
def demo(roomId): | |
tt = int(time.time()) | |
signContent = 'lapi/live/thirdPart/getPlay/%d?aid=pcclient&rate=0&time=%d9TUk5fjjUjg9qIMH3sdnh' % (roomId, tt) | |
sign = md5(signContent).hexdigest() | |
url = 'http://coapi.douyucdn.cn/lapi/live/thirdPart/getPlay/%d?rate=0' % roomId | |
ret = requests.get(url, headers = { | |
'auth': sign, | |
'time': str(tt), | |
'aid': 'pcclient' | |
}) | |
return ret.json() | |
print demo(78561) |
@spacemeowx2 Hi, this API has changed, can you provide some new infomation?
I don't have any account to login https://coapi.douyucdn.cn/.
Very thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this @yan12125