How do we download a blob url video

921,362

Solution 1

I just came up with a general solution, which should work on most websites. I tried this on Chrome only, but this method should work with any other browser, though, as Dev Tools are pretty much the same in them all.

Steps:

  1. Open the browser's Dev Tools (usually F12, or Ctrl-Shift-I, or right-click and then Inspect in the popup menu) on the page with the video you are interested in.
  2. Go to Network tab and then reload the page. The tab will get populated with a list of requests (may be up to a hundred of them or even more).
  3. Search through the names of requests and find the request with .m3u8 extension. There may be many of them, but most likely the first or largest is the one you are looking for. It may have any name, e.g. playlist.m3u8.
  4. Click its name to open the request. Under the Headers subsection you will see request's full URL in the Request URL field. Copy it. enter image description here
  5. Extract the video from m3u8. There are many ways to do it, I'll give you those I tried, but you can google more by "download video from m3u8".
    • Option 1. If you have VLC player installed, feed the URL to VLC using the "Open Network…" menu option. I'm not going to go into details on this part here, there are a number of comprehensive guides in many places, for example, here. If the page doesn't work, you can always google another one by "vlc download online video".
    • Option 2. If you are more into command line, use FFMPEG or your own script, as directed in this SuperUser question.

Solution 2

Use the HLS Downloader Google Chrome extension to get the link to the M3U playlist. Its icon in the browser bar will show the number of playlists found on the current webpage. Clicking on the icon you can then see a list of the playlist link and then use the copy button next to a link to copy it.

Then use the youtube-dl program to download the file.

youtube-dl --all-subs -f mp4 -o "file-name-to-save-as.mp4" "https://link-from-Google_Chrome-HLS_Downloader_extension"

Explanation of command line options:

If you use the same configuration options all the time for youtube-dl you may want to take a look at the configuration options for youtube-dl, as this can save you a lot of typing.

The HLS Downloader extension is free and open source under the MIT license if you want to see the code it can be found on its project page on Github.

Solution 3

There are a variety of ways to get the URL .m3u8 either by viewing the source of a page, looking at the Network tab in the Developer Tools in Chrome, or using a plugin such as HDL/HLS Video Downloader.

With the .m3u8 URL in hand you can then use ffmpeg to download the video to a file like so:

$ ffmpeg -i 'https://url/to/some/file.m3u8' -bsf:a aac_adtstoasc \
    -vcodec copy -c copy -crf 50 file.mp4

Solution 4

This is how I manage to "download" it:

  1. Use inspect-element to identify the URL of the M3U playlist file
  2. Download the M3U file
  3. Use VLC to read the M3U file, stream and convert the video to MP4

In Firefox the M3U file appeared as of type application/vnd.apple.mpegurl

enter image description here

The contents of the M3U file would look like:

Open VLC medial player and use the Media => Convert option. Use your (saved) M3U file as the source:

enter image description here

Solution 5

The process can differ depending on where and how the video is being hosted. Knowing that can help to answer the question in more detail.

As an example; this is how you can download videos with blob links on Vimeo.

  1. View the source code of the video player iframe
  2. Search for mp4
  3. Copy link with token query
  4. Download before token expires

Source & step-by-step instructions here.

enter image description here

Share:
921,362
SidD
Author by

SidD

Updated on July 08, 2022

Comments

  • SidD
    SidD almost 2 years

    I want to download a video whose URL is not a simple MP4 file, but rather a blob type for example:

    <video id="playerVideo" width="450px" autoplay="autoplay" height="338px" 
           style="height:100%;width:100%;" class="mejs-rai-e"
           src="blob:http://www.example.com/d70a74e1-0324-4b9f-bad4-84e3036ad354">
    </video>
    

    Is there any chrome extension or software which can be used to download videos from blob URLs?

  • eapo
    eapo over 6 years
    This method works well even if the filetype in the url isn't .mp4, just check the header of the file and rename it.
  • Admin
    Admin over 5 years
    Great tip! It seems that there's no need to download the m3u8 file - you can just paste the external url as the source.
  • Arnaud Tournier
    Arnaud Tournier over 5 years
    Option 3 is : use the playlist URL directly with youtube-dl, it is very simple !
  • azizj
    azizj about 5 years
    How would you use youtube-dl to do it? just youtube-dl https://....m3u8" ?
  • azizj
    azizj about 5 years
    Also, does this work for private videos?
  • Gibado
    Gibado almost 5 years
    youtube-dl also works for mpd files.
  • patricK
    patricK almost 5 years
    All time I got 403 when downloading m3u8.. Tryed with youtube-dl, firefox extension, vlc player.. What can I do?
  • Vlad Nikiforov
    Vlad Nikiforov almost 5 years
    Looks like a primitive protection from unauthorized downloads, where the server blocks requests where HTTP Referer header is not set to site name. CURL is your friend: curl -O -e example.com example.com/playlist.3u8
  • Searene
    Searene over 4 years
    @patricK You can try adding referer, example: youtube-dl --add-header Referer: https://www.google.com/referer-page https://google.com/video.m3u8
  • Zhou XF
    Zhou XF over 4 years
    mind if I ask, how did you open the search bar in the network module and search for the "m3u8"key words.
  • Vlad Nikiforov
    Vlad Nikiforov over 4 years
    @ZhouXF I usually just hit Ctrl-F (Cmd-F for Mac) while in the network section.
  • pcarvalho
    pcarvalho about 4 years
    on the network tab there's a secondary tab for "Media". it's easier to get the m3u8 file from just a few items.
  • Christopher
    Christopher about 4 years
    This works really nicely except in my case the MP4 had no sound? Is there a way to resolve this?
  • frederickjh
    frederickjh about 4 years
    I have not had his happen. It must be something with the file you are downloading. I believe that the mp4 standard supports multiple audio tracks. Check that there is not another audio track and that the first one is silence.
  • Justin Emlay
    Justin Emlay about 4 years
    Great extention! so much easier then doing all the run around yourself with m3u8 files and just strait blob files. However I didn't need whatever that youtube thing was. HLS Downloader gives me the video files directly.
  • Robin Hartmann
    Robin Hartmann about 4 years
    And Option 4: use JDownloader 2 to download the playlist URL, in my opinion this is the easiest way.
  • Sir Von Berker
    Sir Von Berker about 4 years
    try adding -x within the options
  • Gwyneth Llewelyn
    Gwyneth Llewelyn about 4 years
    In my case, I've tried HLS Downloader with Twitter, and it worked as @Justin said: it gave the video file directly. But I have also tried the suggestions proposed by @Vlad on the other answer — basically doing all the steps manually — with the same results (i.e. getting a working .MP4 file).
  • Gwyneth Llewelyn
    Gwyneth Llewelyn about 4 years
    @AzizJaved aye, exactly like that. I haven't tested it on private videos, but if you can see the page where they are, then they work exactly as on a public video. What matters is what you see on the browser: if you can see it, you can copy it. Simple! 😉
  • Firsh - justifiedgrid.com
    Firsh - justifiedgrid.com almost 4 years
    Do you guys want an article from me on downloading encrypted HLS videos? It's basically step 3 but with ffmpeg to decrypt and combine ts segments.
  • Canelo Digital
    Canelo Digital almost 4 years
    Best approach yet. The only disadvantage I've encounterfed whas that the 8 minutes m3u8 was divided in 5 second steps, and there was a SSL certificate issue, so I had to press pretty much times "accept certificate"...
  • godblessstrawberry
    godblessstrawberry almost 4 years
    here's how you download when you get url with m3u8 -- just run ffmpeg -i "http://example.com/video_url.m3u8" -c copy -bsf:a aac_adtstoasc "output.mp4" (you need to install it obviously)
  • Elias Hasle
    Elias Hasle over 3 years
    I don't know about other platforms, but for Twitter, previewing the .m3u8 file in the "preview" tab of the above view will reveal the URL to the underlying video (.ts) file (relative to the location of the .m3u8 file), which can then be downloaded. I must say Twitter really kills videos with compression (perhaps adjusting severity of compression dynamically by video popularity, server load etc.?)
  • Khadim Ali
    Khadim Ali over 3 years
    A month ago, I was able to download the blob video using this technique. Today, when I tried again for the same video I am not able to find any m3u8 extension file.
  • emazzotta
    emazzotta over 3 years
    if there's no audio I recommend setting the video + audio in the -f parameter. E.g. -f bestvideo+bestaudio this solved the problem for me. You can check via the -F parameter what video and audio options are available. Some sites have videos with different video qualities but with the audio track separated from the video.
  • Khadim Ali
    Khadim Ali over 3 years
    Update to my comment above. For that blobbed video URL, I had found a .mpd file in media files of the networking tab. The .mpd Request URL was there and I had been able to use that URL to download the video using VLC's network streaming/converting feature.
  • Ryan
    Ryan over 3 years
    @godblessstrawberry Thanks! You should post this as an answer.
  • relidon
    relidon over 3 years
    I get "Could not send HEAD request". I am trying to download the subtitles for this trailer at greatcourses
  • frederickjh
    frederickjh about 3 years
    @relidon It looks like the site is blocking the download from outside the web browser. They may be looking for a cookie. I am getting 403 an 405 not allowed HTTP errors. I was able to download it just using the HLS downloader extension. Since it actually has close captions and not subtitles they are embedded in the video. I was able to enable them for playback in VLC.
  • relidon
    relidon about 3 years
    @frederickjh would there be a way to find those close captions within the browser (in network tab or something)? or does close captions actually mean they wouldn't be available?
  • relidon
    relidon about 3 years
    I just downloaded the video using HLS, you are correct. Is there a way to then separate the cc from the downloaded file?
  • coder
    coder about 3 years
    Step 5 alternative:you can put the URL copied from the request URL and put it at the browser search bar and it will dwnload the video ( tested in chrome )
  • frederickjh
    frederickjh about 3 years
    @relidon on linux you can use ccextractor to do this.
  • André M. Faria
    André M. Faria about 3 years
    Hello, this don't work with events.on24, but it's a great extension, helped me a lot
  • AFK
    AFK about 3 years
    this works perfectly for O'Reilly Live Events
  • AbHiNaV AgRaWaL
    AbHiNaV AgRaWaL almost 3 years
    If my video has multiple .m3u8 links, how can we concatenate all our downloads into one for a seamless live video experience? I suppose screen share and live talking together will have 2 different .m3u8 files getting generated and so on for others as well. How can all be concatenated?
  • Kamlesh
    Kamlesh over 2 years
    there is no mp4 keyword found. Not solved my issue.
  • Kamlesh
    Kamlesh over 2 years
    @godblessstrawberry I did not find any m3u8 extension file in Network tab of Developer Tools in chrome browser. Could you please suggest me what is the issue? Thanks
  • Kamlesh
    Kamlesh over 2 years
    @VladNikiforov I did not find any m3u8 extension file in developer tools of chrome browser. FYI I can play video and video url is Blob type. I am 100% sure. Any suggestion what is the issue and solution? Thanks a lot.
  • Kamlesh
    Kamlesh over 2 years
    Not found any m3u8 file in developer tools in chrome. Any suggestion? Thanks
  • Kamlesh
    Kamlesh over 2 years
    @rick Rick here what is youtube-dl? My videos are not of Youtube website. Please suggest. Thanks
  • Kamlesh
    Kamlesh over 2 years
    HLS Downloader link url is broken, google says "The requested URL was not found on this server. That’s all we know" Kindly update the link or remove the link. Thanks a lot.
  • godblessstrawberry
    godblessstrawberry over 2 years
    @Kamlesh maybe this could help stackoverflow.com/a/55071769/1665293
  • Loenix
    Loenix over 2 years
    Not working with facebook blob video in comments.
  • Wiktor Stribiżew
    Wiktor Stribiżew over 2 years
    This sometimes fails to download the full video, unfortunately, maybe the timeout threshold is too small and I do not know where it can be adjusted.
  • Vlad Nikiforov
    Vlad Nikiforov over 2 years
    @Loenix, facebook videos are often easy to download if you switch to mobile version (replace "www." with "m." in the URL).
  • Kamlesh
    Kamlesh over 2 years
    Thanks @godblessstrawberry I have already visited this solution, not solved my problem yet, thanks again.
  • Mikel
    Mikel over 2 years
    The HLS Downloader extension was removed from Chrome Store but it's available for Firefox
  • 2540625
    2540625 over 2 years
    These steps need much more detail to follow.
  • 2540625
    2540625 over 2 years
    @Kamlesh youtube-dl can be installed by brew, and it works on blobs in general, not just from YouTube.
  • Mars2024
    Mars2024 almost 2 years
    This worked perfectly for me: I downloaded Homebrew, and brew install ffmpeg, and youtubedl, and used this command youtube-dl --all-subs -f mp4 -o "Testing.mp4" "m.media-amazon.com/images/S/…", and it worked