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 586 forks source link

reverse engineering website help #1136

Open goncaloruao opened 8 years ago

goncaloruao commented 8 years ago

To start, my tv provider changed their website so that only works on internet explorer with the use of silverlight.

So, i can't use it on linux.

But, i reverse engineered the webpage and the stream that way : webpage gets a manifest like this one : http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/Manifest

and after that keeps playling the stream : http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/QualityLevels(64000)/Fragments(audio=3366031403666)-151121202653916 and changes the url frequently as on picture above : http://imgur.com/ebYU1RP

i believe that it depends on the manifest data.

how can i use livestream to play the streams on vlc ? any tips ?

On the other hand, i'm trying to use the ipad app and have some different links. http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/CCURstream1564000.m3u8 but don't know how to use that link on livestreamer,

tried : " livestreamer hls://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/CCURstream1564000.m3u8 best"

and : livestreamer hlsvariant://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/playlist.m3u8"

but the stream doesnt display well neither has sound . Check the screenshot please : http://s30.postimg.org/3mufb0ewx/Capturar2.jpg (NOTE: Strangely CCURstream1564000.m3u8 has the following line on my ipad and even sometimes on windows :

EXT-X-KEY:METHOD=AES-128,URI="http://10.144.171.17/AES/SecureKey.aspx"

although ipad gets securekey.aspx from http://drm.irisonline.pt/AES/SecureKey.aspx using the http-header user agent : "IRISOnline/8 (iPad; iOS 9.0.2; Scale/2.00)" and not from http://10.144.171.17/AES/SecureKey.aspx despite even showing on the m3u8

on the other hand, sometimes livestreamer says :"Failed to create decryptor: UUnable to open URL : http://10.144.171.17/AES/SecureKey.aspx HTTPConnectionPool(host ='10.144.171.17', port=80)_ ;ax retries exceeded. ................. )

these are the cookies i get on the ipad but dont know how to use them on livestreamer :+1:

version:0 name:"ASP.NET_SessionId" value:"xf5qpxon3er1mm5gawqhzc4b" expiresDate:(null) created:2015-11-25 12:33:03 +0000 sessionOnly:TRUE domain:"login.nos.pt" path:"/" isSecure:FALSE>

version:0 name:".ASPXAUTH" value:"AF8BCCC574D3A5764C5B659D4D43D4DA5C72DE36BA32392354F33C595F3DBDD73C459DD6461F0DC72FCF968585222150AC5DEA44D0996A237F32249B4D5E8862AC019A628505DB277B362CA0970203E84E20E4D2D499118842334A4604BF235820040B89" expiresDate:2015-11-26 22:32:22 +0000 created:2015-11-24 22:32:28 +0000 sessionOnly:FALSE domain:"login.nos.pt" path:"/" isSecure:FALSE>

any tips on how to get this working?

10mins commented 8 years ago

MS SmoothStream manifest: http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/Manifest Adobe HDS manifest: http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/Manifest.f4m Apple HLS manifest; http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/Manifest.m3u8

These streams are PlayReady DRM protected. There are no (known) way to play these streams with external player.

goncaloruao commented 8 years ago

That may be impossible to decrypt but i'm sure that the iPad doesnt access those files :

http://imgur.com/3FsaNRW (Here you have the network info from the app since I open it and it starts platina the channel. Thanks for your support !

No dia quinta-feira, 26 de novembro de 2015, 10mins < notifications@github.com> escreveu:

MS SmoothStream manifest: http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/Manifest Adobe HDS manifest: http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/Manifest.f4m Apple HLS manifest; http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/Manifest.m3u8

These streams are PlayReady DRM protected. There are no (known) way to play these streams with external player.

— Reply to this email directly or view it on GitHub https://github.com/chrippa/livestreamer/issues/1136#issuecomment-159818206 .

ghost commented 8 years ago

PlayReady DRM is also available for iOS devices (Microsoft PlayReady Content Protection Technology). Looking closer at the playlist, I can see the following:

http://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/playlist.m3u8
#EXTM3U
#EXT-X-PLAYREADYHEADER:TgMA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FcAUgBNAEgARQBBAEQARQBSAD4A
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=192000
CCURstream192000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1564000
CCURstream1564000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=464000
CCURstream464000.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=764000
CCURstream764000.m3u8
#EXT-X-PLAYREADYHEADER:TgMAAAEAAQBEAzwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4AQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEIAUQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBWAHgANABlAFkAeAB3AEIAMQBMAGMAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBkAHIAbQAuAGkAcgBpAHMAbwBuAGwAaQBuAGUALgBwAHQALwBMAGkAYwBlAG4AcwBlAFMAZQByAHYAZQByAF8AQwBDAFUAUgAvAHIAaQBnAGgAdABzAG0AYQBuAGEAZwBlAHIALgBhAHMAbQB4ADwALwBMAEEAXwBVAFIATAA+ADwAQwBVAFMAVABPAE0AQQBUAFQAUgBJAEIAVQBUAEUAUwA+ADwASQBJAFMAXwBEAFIATQBfAFYARQBSAFMASQBPAE4APgA4AC4AMQAuADEANQAwADMALgAxADAAMAA8AC8ASQBJAFMAXwBEAFIATQBfAFYARQBSAFMASQBPAE4APgA8AC8AQwBVAFMAVABPAE0AQQBUAFQAUgBJAEIAVQBUAEUAUwA+ADwALwBEAEEAVABBAD4APAAvAFcAUgBNAEgARQBBAEQARQBSAD4A

EXT-X-PLAYREADYHEADER (Base64) = WRMHEADER (UTF-16)

<WRMHEADER xmlns="http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version="4.0.0.0"><DATA><PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>AAAAAAAAAAAAAAAAAAAABQ==</KID><CHECKSUM>Vx4eYxwB1Lc=</CHECKSUM><LA_URL>https://drm.irisonline.pt/LicenseServer_CCUR/rightsmanager.asmx</LA_URL><CUSTOMATTRIBUTES><IIS_DRM_VERSION>8.1.1503.100</IIS_DRM_VERSION></CUSTOMATTRIBUTES></DATA></WRMHEADER>

The strange thing is (as far as I can see it, after investigating a single MPEG-TS file) these files doesn't seem to be encrypted. But although these files are not encrypted, no video player (MPV, MPC-HC, ...) so far seems to handle such files properly.

I saved the stream with the following command line:

livestreamer "hls://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/CCURstream1564000.m3u8" best -o 01.ts
[cli][info] Found matching plugin stream for URL hls://217.70.67.2/nospr/live-spts/media/EPGC5/transmux/CCURstream1564000.m3u8
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (hls)

FFPLAY plays the file, but shows a lot of error messages. I can only see some short fragments of the real video (no sound and mostly black screen).

goncaloruao commented 8 years ago

Does anyone has new suggestions?

CrystalStreams commented 8 years ago

Es um pouco estupido se é que posso afirmar isso, vens aqui postar cenas da NOS, eu já há 6 meses para cá que tenho visto no IE e sem problemas ou no meu Iphone. Queres ver os canais, paga! Eu sei resolver o teu problema, mas pensa, quanto mais longe fores, mais rapido eles mudam de proteccção!