Advertisement
mattrix

Untitled

Dec 10th, 2017
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.59 KB | None | 0 0
  1. import requests, sys
  2.  
  3. auth = "2f0XXXXX-XXXX-XXXX-XXXX-XXXXXXXXX"
  4. url = "https://vmndmdl.foxsports.com.au/api/web/asset/7099/play?app_name=webapp&protocol=hls"
  5.  
  6. headers = {
  7.     "authorization": "Bearer {0}".format(auth),
  8.     "accept" : "application/json;v=2",
  9. }
  10.  
  11. json_payload = {
  12.     "playRequest": {"authorize": {"device": {"udid": auth, "label": "Chrome Windows 10"}}},
  13. }
  14.  
  15. data = requests.post(url, json=json_payload, headers=headers).json()
  16. if data.get('code'):
  17.     print("ERROR: {0}".format(data.get('description')))
  18.     sys.exit(0)
  19.  
  20. url = data['playbackItems'][0]['url']
  21. print(url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement