dragonbane

twitch HLS Stream

Feb 11th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. https://usher.ttvnw.net/api/channel/hls/runnerguy2489.m3u8
  2.  
  3. https://api.twitch.tv/api/channels/runnerguy2489/access_token
  4.  
  5. if type == "live":
  6. endpoint = "channels"
  7. value = self.channel
  8. sig, token = self.api.access_token(endpoint, value, schema=_access_token_schema)
  9.  
  10. params = {
  11. "player": "twitchweb",
  12. "p": int(random() * 999999),
  13. "type": "any",
  14. "allow_source": "true",
  15. "allow_audio_only": "true",
  16. "allow_spectre": "false",
  17. "sig": sig,
  18. "token": token
  19. }
  20.  
  21. streams = HLSStream.parse_variant_playlist(self.session, url, force_restart=not stream_type == "live")
Add Comment
Please, Sign In to add comment