chrippa / livestreamer

Command-line utility that extracts streams from various services and pipes them into a video player of choice. No longer maintained, use streamlink or youtube-dl instead.
http://livestreamer.io/
BSD 2-Clause "Simplified" License
3.88k stars 582 forks source link

Need some advice on livestreamer with Wowza streaming server #1095

Open ellegance opened 9 years ago

ellegance commented 9 years ago

I recently dived into livestreamer, and found option to set cookie in request to playlist --http-cookie. AFAIK Wowza server requies "md5" and "e" cookies (some explanation here http://www.wowza.com/forums/content.php?59 methods onHTTPCupertinoEncryptionKeyCreateLive, onHTTPCupertinoEncryptionKeyCreateVOD) and if I'm not confused these both cookies are calculated in flash player. I need advice, is it possible to get these cookies by some manipulations with server? For test you can use http://live.russia.tv/ it uses such flashplayer with Wowza server, but it requires cookies to get stream by livestreamer and it works only for session for limited time. Thanks in advance.

ghost commented 9 years ago

For test you can use http://live.russia.tv/ it uses such flashplayer with Wowza server, but it requires cookies to get stream by livestreamer and it works only for session for limited time.

Playlist is accessible even without cookies:

livestreamer "hlsvariant://http://live.hls.vgtrk.cdnvideo.ru/live/smil:r1.smil/playlist.m3u8?md5=Z_BQyoIlrFLDiUWLXHd87A&e=1445189901" best
[cli][info] Found matching plugin stream for URL hlsvariant://http://live.hls.vgtrk.cdnvideo.ru/live/smil:r1.smil/playlist.m3u8?md5=Z_BQyoIlrFLDiUWLXHd87A&e=1445189901
[cli][info] Available streams: 400k (worst), 800k, 1600k (best)
[cli][info] Opening stream: 1600k (hls)
[cli][info] Starting player: "C:\Program Files (x86)\Video\MPC-HC\mpc-hc.exe"
ellegance commented 9 years ago

It works without cookies but you use these both parameters md5 && e in http get request. They become invalid after some time, I want to find way how to get them again automatically when they get expired.

ellegance commented 9 years ago

And also these md5 and e parameters are wired to IP or smth like session, because I cannot use your's, it gives me forbidden error. So the only solution for now is to open link in browser, get these md5 and e and then provide them to livestreamer.

ghost commented 9 years ago

Write a Livestreamer plugin to get those parameters automatically.

https://player.vgtrk.com/iframe/datalive/id/2961/sid/rutv

An RTMP stream is also available:

livestreamer "rtmp://vgtrk.cdnvideo.ru/rr2/?auth=vh&cast_id=2961 app=rr2/?auth=vh&cast_id=2961 swfUrl=http://player.rutv.ru/flash3v/player_engine.swf playpath=rtp_r1_hq live=1" best
[cli][info] Found matching plugin stream for URL rtmp://vgtrk.cdnvideo.ru/rr2/?auth=vh&cast_id=2961 app=rr2/?auth=vh&cast_id=2961 swfUrl=http://player.rutv.ru/flash3v/player_engine.swf playpath=rtp_r1_hq live=1
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (rtmp)
[cli][info] Starting player: "C:\Program Files (x86)\Video\MPC-HC\mpc-hc.exe"
ellegance commented 9 years ago

Thanks a lot, genius solution for rtmp stream. I will try to write plugin to fetch hls stream, you convinced me that it is implementable, because I doubt maybe some strong drm used. By the way, how to check if service allows rtmp stream? user-agent spoof or smth like that?