PDA

View Full Version : avoiding F4M Akamai DRM by pretending to be iPhone -> M3U8


mickrose
01-14-2016, 10:23 AM
hello,

I can successfully get an MP4 using youtube-dl on Windows7 from SWISS TV page:
www.rts.ch/play/tv/einstein/video/emission-40?id=6855800

(m3u8 manifest is used)
valid cmd= C:\Users\xxxxxx\AppData\Local\Programs\Python\Pyth on35-32>youtube-dl "http://
www.rts.ch/play/tv/einstein/video/emission-40?id=6855800"

another content has stronger protection DRM and I cannot download:

http://www.rts.ch/play/tv/histoire-vivante/video/nasser--13?id=7401279

I get:
[RTS] 7401279: Downloading JSON metadata
[RTS] 7401279: Downloading JSON metadata
[RTS] 7401279: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 403: Forbidden
[RTS] 7401279: Downloading hds token
[RTS] 7401279: Downloading f4m manifest
WARNING: Unable to download f4m manifest: HTTP Error 403: Forbidden
[...]
-------------------------------------------
On my iPhone, I see with developer tools (connect iphone to Mac with USB cable...) that a master.m3u8 is used to play the stream in Safari.

How can I pretend to be an iOS device from Windows (iPad mode) ? the user agent value seems to be overruled for some reason if I use a Firefox addon or HDS Link detector + youtube-dl.

thanks

peterpan
01-14-2016, 11:09 AM
You may have to sniff out a new link...using iPad or iPhone User Agent. Get the link for the resolution your want and play it in VLC. in VLC, go to View=>Advanced Control and Record the video ;)


Open the link you sniff out (see below) in text editor
https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/master.m3u8?start=0&end=3478&hdnts=exp=1452794653~acl=/i/hisvi/*~hmac=cea70a4d7735ac6151cef7013e377de7273e6a5b338 85cd94cc5d98ca951f741

And you'll find the following...

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=146000,RESOLUTION=320x180,CODECS="avc1.66.30, mp4a.40.2",CLOSED-CAPTIONS=NONE
https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/index_0_av.m3u8?start=0&end=3478&id=AgBNO9fYWZWvVBHjl1a76F0Sh4+lI%2fXrzwbhjot7lNadX 5m2Si1irkiuebvrUHrQ0BUxnuE7ZhoH9A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=346000,RESOLUTION=480x270,CODECS="avc1.66.30, mp4a.40.2",CLOSED-CAPTIONS=NONE
https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/index_1_av.m3u8?start=0&end=3478&id=AgBNO9fYWZWvVBHjl1a76F0Sh4+lI%2fXrzwbhjot7lNadX 5m2Si1irkiuebvrUHrQ0BUxnuE7ZhoH9A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=660000,RESOLUTION=512x288,CODECS="avc1.77.30, mp4a.40.2",CLOSED-CAPTIONS=NONE
https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/index_2_av.m3u8?start=0&end=3478&id=AgBNO9fYWZWvVBHjl1a76F0Sh4+lI%2fXrzwbhjot7lNadX 5m2Si1irkiuebvrUHrQ0BUxnuE7ZhoH9A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1324000,RESOLUTION=640x360,CODECS="avc1.77.30, mp4a.40.2",CLOSED-CAPTIONS=NONE
https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/index_3_av.m3u8?start=0&end=3478&id=AgBNO9fYWZWvVBHjl1a76F0Sh4+lI%2fXrzwbhjot7lNadX 5m2Si1irkiuebvrUHrQ0BUxnuE7ZhoH9A%3d%3d
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=47000,CODECS="mp4a.40.2",CLOSED-CAPTIONS=NONE
https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/index_0_a.m3u8?start=0&end=3478&id=AgBNO9fYWZWvVBHjl1a76F0Sh4+lI%2fXrzwbhjot7lNadX 5m2Si1irkiuebvrUHrQ0BUxnuE7ZhoH9A%3d%3d


http://i.imgur.com/IoMwPOnm.png http://i.imgur.com/3t4AkPem.png

mickrose
01-14-2016, 04:10 PM
Brilliant ,peter!
I had no idea VLC could do what getflv or a cmd + php does...
I still need your kind help on the snif out part: i can get the m3u8 manifest from my iOS device or from getflv but it's annoying. So which user agent plugin/ extention are u using under Ffox or Chrome?

coasterghost
01-15-2016, 12:31 AM
Brilliant ,peter!
I had no idea VLC could do what getflv or a cmd + php does...
I still need your kind help on the snif out part: i can get the m3u8 manifest from my iOS device or from getflv but it's annoying. So which user agent plugin/ extention are u using under Ffox or Chrome?

I generally use iOS or Android user agents in User-Agent Switcher for chrome

mickrose
01-15-2016, 07:40 AM
Thanks but it doesn't work, User-Agent Switcher for Chrome still calls the F4M and not the M3u8 like my iPhone.

peterpan
01-15-2016, 08:50 AM
User-Agent Switcher for chrome is what I've used!

mickrose
01-17-2016, 01:24 AM
Anyone? The video is still online for 20 hours.
My PC always calls the F4M so the user agent switcher cannot simulate an iPhone!
Please help by providing details on how to make Windows call the m3u8.

thanks

biezom
01-17-2016, 03:31 AM
hi

two others ways


1) use hds link detector addon on firefox and AdobeHDS.php that manage F4M Akamai DRM

php AdobeHDS.php --manifest "http://rtsch-f.akamaihd.net/z/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/manifest.f4m?hdnts=exp=1453027213~acl=/z/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/*~hmac=137e9b065be0d883a5adf5765125e58cd3e85a9ce6f 758f8ee0265a97abd5d87&g=TXQKYLDNIQGR&hdcore=3.4.0&plugin=aasp-3.4.0.132.66" --delete --auth "pvtoken=exp%3D9999999999%7Eacl%3D%252f%252a%7Edata %3DZXhwPTE0NTMxMTM1ODR+YWNsPSUyZip+ZGF0YT1wdmMsc35 obWFjPTg3ODgxOTFhNWU4ODQxNWYwMDg0ZTQ5Y2Y5MTE4YTE1M DNiZjdkOGI1ZDFjOWMwZGQ4MTEwYWU1ZDk2OTUxMjA%3D%21uP h3SVIi1cGo1lU6lZ/Yb9uPMdM1NDxHuH/x0rp58As%3D%7Ehmac%3D7EE7EA06C418A7FEC9F73C58229AB 85D0337F8024E70BED1E5954968C40A27D4&hdntl=exp=1453113584~acl=%2fz%2fhisvi%2f2016%2fhis vi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil%2f*~data=hdntl~hmac= e31e0c0892e4af899a8cf47d758dd5c71d4450aa3949a467e1 b4d671c8c1d800&als=0,3,NaN,3,0,NaN,0,0,0,37,f,0,3478.24,f,s,TXQKY LDNIQGR,3.4.0,37&hdcore=3.4.0&plugin=aasp-3.4.0.132.66" --useragent "Mozilla/5.0 (X11; Linux i686; rv:43.0) Gecko/20100101 Firefox/43.0 Iceweasel/43.0.4"

KSV Adobe HDS Downloader

Processing manifest info....
Quality Selection:
Available: 1324 660 346 146
Selected : 1324
Fragments Total: 1152, First: 1, Start: 1, Parallel: 8
SessionKey: 8bba515d2f6aa92ffdf75d03eb18a55f
Downloading 72/1152 fragments



2)you have http://rtsch-f.akamaihd.net/z/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/manifest.f4m?................

http://rtsch-f.akamaihd.net/z//2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/manifest.f4m? >>>>>>>


https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/master.m3u8?


and open this link to get "authparams" it expire quickly ~30 seconds


http://tp.srgssr.ch/akahd/token?acl=/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/*


so https://rtsch-i.akamaihd.net/i/hisvi/2016/hisvi_20160110_full_f_914902-,101,301,701,1201,k.mp4.csmil/master.m3u8?authparams

mickrose
01-17-2016, 08:06 AM
OK, surprisingly option 1 worked from home, thanks a lot! So either the firewall at work has an impact or the PHP version is slightly different but it did not work from work BUT another content from that same site DID WORK. Very strange.