Skip to content

Instantly share code, notes, and snippets.

@spacemeowx2
Created March 4, 2017 04:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spacemeowx2/629b1d131bd7e240a7d28742048e80fc to your computer and use it in GitHub Desktop.
Save spacemeowx2/629b1d131bd7e240a7d28742048e80fc to your computer and use it in GitHub Desktop.
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
Copy link
Author

Try this @yan12125

@steven7851
Copy link

@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