Hi,
anyone can I help me to download a streaming video from vod movistar.es?
links:
http://b38545.1.vod.cdn.telefonica.com/38545/prod/hls/cplus-1422250_cplus-1422250-hls_...ex-02-spa.m3u8
http://b38545-p67-h29.1.vod.cdn.telefonica.com/_38545/prod/hls/cplus-1422250_cplus-142...083550/05.m3u8
I tried to download with youtube-dl but it's not working...
Thank you
+ Reply to Thread
Results 1 to 4 of 4
-
-
This video not playing when i add to my player online
-
Hi Bryan_122!
Lately I've been trying to download VoD from Movistar without luck. Both URLs you post are perfectly valid, but they're encrypted in a way I struggle to understand.
In this post I'll to explain what I've found so far, so anyone interested could solve this once and for all
1. Getting stream data
Ok, let's take your first link as an starting point for this example: http://XXXXX.vod.cdn.telefonica.com/.../index-02-spa.m3u8
This M3U8 file contains all SD qualities available for that digital content. But, and here's the trick, if we request index-01-spa.m3u8 instead, we get all available streams (both SD and HD):
Code:#EXTM3U #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=5895680,RESOLUTION=1280x720,CODECS="avc1.4d4020,mp4a.40.2" 01.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=4355584,RESOLUTION=1280x720,CODECS="avc1.4d4020,mp4a.40.2" 03.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2815488,RESOLUTION=1024x576,CODECS="avc1.4d401f,mp4a.40.2" 05.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2200352,RESOLUTION=1024x576,CODECS="avc1.4d401e,mp4a.40.2" 07.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2200352,RESOLUTION=640x360,CODECS="avc1.4d4015,mp4a.40.2" 09.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1481440,RESOLUTION=640x360,CODECS="avc1.4d401f,mp4a.40.2" 11.m3u8 #EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1173120,RESOLUTION=480x270,CODECS="avc1.4d401f,mp4a.40.2" 13.m3u8
Code:#EXTM3U #EXT-X-VERSION:3 #EXT-X-TARGETDURATION:11 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-KEY:METHOD=AES-128,URI="http://www.nagra.com/key=268327&prm=eyJjb250ZW50SWQiOiIyNjgzMjciLCJrZXlJZCI6ImFhZTk5NzhjLWJkZGUtNDMyZi1hMDg3LTYxNTI4MjVkZjVlZCJ9",IV=0x00000000000000000000000000000000 #EXTINF:10, 01-0.ts #EXTINF:10, 01-1.ts [...] #EXTINF:5.6, 01-326.ts #EXT-X-ENDLIST
2. Extracting the key
Now, this is when this gets tricky. Due to the stream being encrypted we need a way to decrypt it before merging all TS files. This is usually achieved by using FFMPEG:
Code:ffmpeg -protocol_whitelist "file,http,https,tcp,tls,crypto" -allowed_extensions ALL -i "http://XXXXX.vod.cdn.telefonica.com/.../01.m3u8" -c copy "output.ts"
FFMPEG is trying to download the key specified in the M3U8, which is supposed to be located at http://www.nagra.com/key=268327&prm=a_really_long_base64_string. But that URL doesn't exists, and the Movistar player has to be taking the decryption key from somewhere.
After doing some traffic captures, I came to the conclusion that the key has to be hidden inside the M3U8 file.
3. Understanding the key
Let's take that long string from the fake key URL: eyJjb250ZW50SWQiOiIyNjgzMjciLCJrZXlJZCI6ImFhZTk5Nz hjLWJkZGUtNDMyZi1hMDg3LTYxNTI4MjVkZjVlZCJ9.
If we Base64-decode it, we get this JSON object:
Code:{"contentId":"268327","keyId":"aae9978c-bdde-432f-a087-6152825df5ed"}
We seem to have found the decryption key: 0xaae9978cbdde432fa0876152825df5ed. But... that doesn't work either, as FFMPEG returns this error message:
Code:Error when loading first segment 'http://b38545.1.vod.cdn.telefonica.com/38545/prod/hls/cplus-1422250_cplus-1422250-hls_20170921_083550/01-0.ts' D:\ConsoleProjects\tmp\stream.m3u8: Invalid data found when processing input
Conclusion
This is what I've got so far. I've have no idea why this doesn't work, so any help will be appreciated. I attach three files if you want to test this for yourself:
- stream.m3u8: contains the parsed stream file with the key path fixed
- stream.key: the 16 bytes decryption key
- command.bat: the FFMPEG command
-
Similar Threads
-
How do I download the following m3u8 url?
By AshleyQuick in forum Video Streaming DownloadingReplies: 33Last Post: 22nd Aug 2020, 04:17 -
Download m3u8
By quekkiefly in forum Video Streaming DownloadingReplies: 0Last Post: 12th Jan 2017, 06:40 -
Download m3u8 playlist
By aviergaz in forum Video Streaming DownloadingReplies: 3Last Post: 16th Sep 2016, 10:18 -
How do I download the following m3u8?
By AshleyQuick in forum Video Streaming DownloadingReplies: 2Last Post: 4th Oct 2015, 02:13 -
How to download m3u8 stream ?
By andyleo in forum Video Streaming DownloadingReplies: 3Last Post: 19th Feb 2014, 09:05