How to download Dash video files as they appear on the server?

Peter Tseng picture Peter Tseng · Aug 25, 2018 · Viewed 38.6k times · Source

Is it possible, given an mpd file like https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd, to easily download all the Dash files stored on the server (assuming we know that it's static content on the server). That is, I should be able to run an HTTP server serving the content I downloaded, and point a Dash player at it to play the same video.

youtube-dl does not seem to give me the Dash package. I could use curl to perform XHR requests like the browser, but I'm hoping there's an easier way.

enter image description here

Answer

Alex X. picture Alex X. · Oct 8, 2018

No need to develop a wheel!

The grand tool youtube-dl knows hundreds of platforms/protocols/etc as well as MPEG DASH as well as Apple HLS and so on and so forth! Very often updates/bugfixes

Have fun!

http://rg3.github.io/youtube-dl/

PS.: If you want to keep fragments - use the option

--keep-fragments                 

Keep downloaded fragments on disk after downloading is finished; fragments are erased by default

Upd:

Your playlist has plenty of options (based on video bandwidth), eg:

youtube-dl.exe -F https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd
[generic] bbb_30fps: Requesting header
WARNING: Falling back on generic information extractor.
[generic] bbb_30fps: Downloading webpage
[generic] bbb_30fps: Extracting information
[info] Available formats for bbb_30fps:
format code                 extension  resolution note
bbb_a64k                    m4a        audio only DASH audio   67k , m4a_dash container, mp4a.40.5 (48000Hz)
bbb_30fps_320x180_200k      mp4        320x180    DASH video  254k , mp4_dash container, avc1.64000d, 30fps, video only
bbb_30fps_320x180_400k      mp4        320x180    DASH video  507k , mp4_dash container, avc1.64000d, 30fps, video only
bbb_30fps_480x270_600k      mp4        480x270    DASH video  759k , mp4_dash container, avc1.640015, 30fps, video only
bbb_30fps_640x360_800k      mp4        640x360    DASH video 1013k , mp4_dash container, avc1.64001e, 30fps, video only
bbb_30fps_640x360_1000k     mp4        640x360    DASH video 1254k , mp4_dash container, avc1.64001e, 30fps, video only
bbb_30fps_768x432_1500k     mp4        768x432    DASH video 1883k , mp4_dash container, avc1.64001e, 30fps, video only
bbb_30fps_1024x576_2500k    mp4        1024x576   DASH video 3134k , mp4_dash container, avc1.64001f, 30fps, video only
bbb_30fps_1280x720_4000k    mp4        1280x720   DASH video 4952k , mp4_dash container, avc1.64001f, 30fps, video only
bbb_30fps_1920x1080_8000k   mp4        1920x1080  DASH video 9914k , mp4_dash container, avc1.640028, 30fps, video only
bbb_30fps_3840x2160_12000k  mp4        3840x2160  DASH video 14931k , mp4_dash container, avc1.640033, 30fps, video only (best)

now, if you wish you download ALL the segments for all the bitrates, you could try to use the magic option

--all-formats

or you could do it one by one using the --format option, e.g.:

youtube-dl.exe --format bbb_30fps_320x180_200k --keep-fragments