PDA

View Full Version : Downloading encrypted m3u8 (ffmpeg error) from Bioscope.tv


ratherbe
09-24-2017, 03:05 PM
So I'm trying to download 1080p videos from this website that uses JWPlayer.

Link to example video: http://www.bioscopelive.com/en/watch?v=76PgzzlSKfk

So naturally I tried youtube-dl first, it decoded the .m3u8 file, fell back to ffmpeg to download it. And this error appeared:

youtube-dl http://www.bioscopelive.com/en/watch?v=76PgzzlSKfk
[generic] watch?v=76PgzzlSKfk: Requesting header
WARNING: Falling back on generic information extractor.
[generic] watch?v=76PgzzlSKfk: Downloading webpage
[generic] watch?v=76PgzzlSKfk: Extracting information
[generic] watch?v=76PgzzlSKfk: Downloading m3u8 information
[generic] watch?v=76PgzzlSKfk: Downloading m3u8 information
WARNING: Failed to download m3u8 information: HTTP Error 403: Forbidden
[hlsnative] Downloading m3u8 manifest
WARNING: hlsnative has detected features it does not support, extraction will be delegated to ffmpeg
[download] Destination: Feluda - Sheyal Debota Rohossho - Episode 01-watchv=76PgzzlSKfk.mp4
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.37)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[hls,applehttp @ 0x7fbfed000000] Opening 'http://s3-ap-southeast-1.amazonaws.com/bongo-key/keys/encryption2.key' for reading
[http @ 0x7fbfec412f20] HTTP error 403 Forbidden
Unable to open key file http://s3-ap-southeast-1.amazonaws.com/bongo-key/keys/encryption2.key
[hls,applehttp @ 0x7fbfed000000] Opening 'crypto+http://vod.bioscopelive.com/vod/vod/7/6/76PgzzlSKfk/76PgzzlSKfk_1080p.ts' for reading
[hls,applehttp @ 0x7fbfed000000] Error when loading first segment 'http://vod.bioscopelive.com/vod/vod/7/6/76PgzzlSKfk/76PgzzlSKfk_1080p.ts'
http://vod.bioscopelive.com/vod/vod/7/6/76PgzzlSKfk/76PgzzlSKfk_1080p.m3u8: Invalid data found when processing input


ERROR: ffmpeg exited with code 1


I also tried to get the .m3u8 from 'Source' in browser dev tools and ran it with ffmpeg to copy the stream.

This is the output:

ffmpeg -i "http://vod.bioscopelive.com/vod/vod/7/6/76PgzzlSKfk/76PgzzlSKfk_1080p.m3u8" -c copy video.ts
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.37)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[hls,applehttp @ 0x7f9aa7800000] Opening 'http://s3-ap-southeast-1.amazonaws.com/bongo-key/keys/encryption2.key' for reading
[http @ 0x7f9aa660d100] HTTP error 403 Forbidden
Unable to open key file http://s3-ap-southeast-1.amazonaws.com/bongo-key/keys/encryption2.key
[hls,applehttp @ 0x7f9aa7800000] Opening 'crypto+http://vod.bioscopelive.com/vod/vod/7/6/76PgzzlSKfk/76PgzzlSKfk_1080p.ts' for reading
[hls,applehttp @ 0x7f9aa7800000] Error when loading first segment 'http://vod.bioscopelive.com/vod/vod/7/6/76PgzzlSKfk/76PgzzlSKfk_1080p.ts'
http://vod.bioscopelive.com/vod/vod/7/6/76PgzzlSKfk/76PgzzlSKfk_1080p.m3u8: Invalid data found when processing input


Is there any other way that I can download the video? Thanks!


Update 1: Using jDownloader and the .ts file , I downloaded a 1.76GB .ts file, but it won't open in any player, and has no MediaInfo.

https://i.imgur.com/KHgZwxp.png (https://i.imgur.com/KHgZwxp.png)

No dice so far.

Yelloworanges
09-24-2017, 09:22 PM
... Using jDownloader and the .ts file , I downloaded a 1.76GB .ts file, but it won't open in any player, and has no MediaInfo.

No dice so far.

If you downloaded the full 76PgzzlSKfk_1080p.ts file, you can decrypt it with ffmpeg using a small edited m3u8 file (http://www42.zippyshare.com/v/aar3Y9N8/file.html) as the input.

Copy

76PgzzlSKfk_1080p.ts
76PgzzlSKfk_1080p.m3u8
encryption2.key

into the same folder along with ffmpeg (if necessary). Then run ffmpeg command line:

ffmpeg -i "76PgzzlSKfk_1080p.m3u8" -vcodec copy -acodec copy -absf aac_adtstoasc "76PgzzlSKfk_1080p.mp4"

ratherbe
09-25-2017, 03:00 AM
If you downloaded the full 76PgzzlSKfk_1080p.ts file, you can decrypt it with ffmpeg using a small edited m3u8 file (http://www42.zippyshare.com/v/aar3Y9N8/file.html) as the input.

Copy

76PgzzlSKfk_1080p.ts
76PgzzlSKfk_1080p.m3u8
encryption2.key

into the same folder along with ffmpeg (if necessary). Then run ffmpeg command line:

ffmpeg -i "76PgzzlSKfk_1080p.m3u8" -vcodec copy -acodec copy -absf aac_adtstoasc "76PgzzlSKfk_1080p.mp4"

You're a wizard!

Alright so at first I did that and ffmpeg returned this:

ffmpeg -i "76PgzzlSKfk_1080p.m3u8" -vcodec copy -acodec copy -absf aac_adtstoasc "76PgzzlSKfk_1080p.mp4"
ffmpeg version 3.3.4 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.37)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.3.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma --enable-vda
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[hls,applehttp @ 0x7f8e39802600] Filename extension of 'encryption2.key' is not a common multimedia extension, blocked for security reasons.
If you wish to override this adjust allowed_extensions, you can set it to 'ALL' to allow all
Unable to open key file encryption2.key
[hls,applehttp @ 0x7f8e39802600] Opening 'crypto:76PgzzlSKfk_1080p.ts' for reading
[hls,applehttp @ 0x7f8e39802600] Error when loading first segment '76PgzzlSKfk_1080p.ts'
76PgzzlSKfk_1080p.m3u8: Invalid data found when processing input


So I allowed extensions using -allowed_extensions ALL and then it worked perfectly! Video is playable.

Since there's a few more episodes I need to download. I need to get the encryption key from each video to do that, right? Thanks!

And looking at your custom m3u8 file, it looks like the only change I need to is to change the filename in line 7 in my photo, correct?

https://i.imgur.com/XCHybn6.png

Yelloworanges
09-25-2017, 01:58 PM
Since there's a few more episodes I need to download. I need to get the encryption key from each video to do that, right?
They may be using the same encryption key file (encryption2.key) on different videos. If so, you can use the same file with other videos. If the encryption key for other videos has a different name, you'll have to get that key.

And looking at your custom m3u8 file, it looks like the only change I need to is to change the filename in line 7 in my photo, correct?
That's right.

surya987
09-25-2017, 09:19 PM
could you tell me in which country this video is playable..???