530

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?

Carson
  • 6,105
  • 2
  • 37
  • 45
SidD
  • 5,697
  • 4
  • 18
  • 30
  • 293
    Why does every single answer to this question assume the file extension is `.m3u8`? That was never specified in the question. – numbermaniac Dec 21 '19 at 09:58
  • 2
    Hello @SidD, were you able to solve this issue? If so, could you please let me know which solution worked for you? – hagrawal7777 Jan 28 '20 at 20:10
  • 7
    I don't have an .m3u8 request. What do I do? – mishap Mar 23 '20 at 19:47
  • 4
    In the general case it's necessary to understand [what blob URL is](https://stackoverflow.com/questions/30864573/what-is-a-blob-url-and-why-it-is-used). Then it's possible to intercept calls to blob URL creation and obtain the source data. – user202729 Mar 27 '20 at 13:33
  • 1
    @numbermaniac I had the same problem, and there was no .m3u8 file. My solution: Locate the video element and run a code snippet in the console, that: 1. Plays the video and records s=video.captureStream() using r=new MediaRecorder(s), 2. Converts the recorded data into an objectURL using URL.createObjectURL(blob), and 3. adds a visible and clickable link for downloading with the objectURL. I never tried just creating the download link from the blob URL in the video.src, though. https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API/Recording_a_media_element – Elias Hasle Nov 16 '20 at 13:30
  • 1
    @user202729 how? if you can provide solution for puppeteer this would be brilliant – Sebastian Feb 04 '21 at 23:45
  • why everyone assume that people wants to download a video? sometimes the only thing needed is to get stream url – Sebastian Feb 04 '21 at 23:46
  • 4
    While this is off-topic on this site (not specific to programming), it's on-topic on Super User: [How to download video with blob url? - Super User](https://superuser.com/questions/1033563/how-to-download-video-with-blob-url) – user202729 Feb 12 '21 at 02:30
  • @numbermaniac lol – AndrewL64 Apr 02 '21 at 18:48
  • The easiest way I found was to use the browser extension: https://www.downloadhelper.net/ – Caio Mar Feb 28 '22 at 17:03
  • try install extension "HLS Downloader" is work a fine. – KingRider Apr 04 '23 at 18:14

9 Answers9

543

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.
2540625
  • 11,022
  • 8
  • 52
  • 58
Vlad Nikiforov
  • 6,052
  • 1
  • 12
  • 18
  • 14
    [youtube-dl](http://ytdl-org.github.io/youtube-dl/) also works for mpd files. – Gibado May 17 '19 at 04:58
  • 5
    All time I got 403 when downloading m3u8.. Tryed with youtube-dl, firefox extension, vlc player.. What can I do? – patricK Jun 21 '19 at 20:41
  • 1
    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 https://example.com https://example.com/playlist.3u8 – Vlad Nikiforov Jun 22 '19 at 21:54
  • 14
    @patricK You can try adding referer, example: `youtube-dl --add-header Referer: https://www.google.com/referer-page https://google.com/video.m3u8` – Searene Sep 01 '19 at 02:59
  • 1
    mind if I ask, how did you open the search bar in the network module and search for the "m3u8"key words. – Zhou XF Nov 22 '19 at 15:00
  • 1
    @ZhouXF I usually just hit Ctrl-F (Cmd-F for Mac) while in the network section. – Vlad Nikiforov Nov 23 '19 at 18:03
  • 6
    And Option 4: use JDownloader 2 to download the playlist URL, in my opinion this is the easiest way. – Robin Hartmann Mar 22 '20 at 15:38
  • 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.?) – Elias Hasle Sep 15 '20 at 09:31
  • 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. – Khadim Ali Sep 24 '20 at 17:22
  • 2
    **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. – Khadim Ali Nov 22 '20 at 23:01
  • 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 ) – coder Feb 06 '21 at 20:39
  • 1
    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? – loyala Jul 27 '21 at 12:51
  • @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 Aug 09 '21 at 18:05
  • Not working with facebook blob video in comments. – Loenix Aug 27 '21 at 14:26
  • @Loenix, facebook videos are often easy to download if you switch to mobile version (replace "www." with "m." in the URL). – Vlad Nikiforov Aug 28 '21 at 23:31
  • 2
    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" "https://m.media-amazon.com/images/S/vse-vms-transcoding-artifact-us-east-1-prod/5f16039a-99c1-45a9-84e9-6518dc143", and it worked – Mars2024 May 09 '22 at 03:20
  • If for some reason the video file is not working, and the URL ends with a `ByteStart` and `ByteEnd`, simply set `ByteStart` to zero and remove the `ByteEnd`: `&bytestart=844&byteend=911` -> `&bytestart=0` – Nicke Manarin Oct 20 '22 at 12:54
  • 1
    https://m3u8.dev -----> **.m3u8 online video extractor** – mehmet Nov 06 '22 at 12:30
  • 1
    I used the m3u8chunks_download.pl (https://github.com/tetemes/m3u8) and it works like a charm. Usage: perl m3u8chunks_download.pl "http://Link_to_m3u8_file" [outpath/outfile.mp4] – lynx_74 Apr 26 '23 at 15:03
  • How does VLC download the m3u8 video? That information would be programming related. – ryanwebjackson Apr 28 '23 at 01:03
  • @Loenix For facebook videos, the network tab should show an mp4 instead of an m3u8 and it will be the URL for the match under the "type" column as "media". But note that the URL will not end in `.mp4` – mchid Aug 17 '23 at 18:29
127

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:

  • -f mp4 = Output format mp4

  • --all-subs = Download all subtitles

  • -o "file-name-to-save-as.mp4" = Name of the file to save the video as.

  • "https://link-from-Google_Chrome-HLS_Downloader_extension" = This is the link to the playlist you copied from the HLS Downloader extension.

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.

Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
frederickjh
  • 1,739
  • 1
  • 11
  • 10
  • This works really nicely except in my case the MP4 had no sound? Is there a way to resolve this? – Christopher Feb 19 '20 at 19:37
  • 4
    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. – frederickjh Feb 21 '20 at 07:54
  • 2
    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. – Justin Emlay Mar 06 '20 at 18:34
  • 1
    try adding -x within the options – Sir Von Berker Apr 04 '20 at 19:18
  • 2
    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 Apr 08 '20 at 11:34
  • 2
    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. – emazzotta Oct 04 '20 at 17:06
  • I get "Could not send HEAD request". I am trying to download the subtitles for this trailer at [greatcourses](https://www.thegreatcoursesplus.com/the-life-and-works-of-jane-austen) – relidon Feb 02 '21 at 15:08
  • @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. – frederickjh Feb 03 '21 at 20:54
  • @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 Feb 04 '21 at 13:44
  • I just downloaded the video using HLS, you are correct. Is there a way to then separate the cc from the downloaded file? – relidon Feb 04 '21 at 14:18
  • @relidon on linux you can use `ccextractor` to do this. – frederickjh Feb 13 '21 at 16:47
  • 1
    `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. – Kamlesh Aug 09 '21 at 18:16
  • The `HLS Downloader` extension was removed from Chrome Store but it's available for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/hls-downloader/) – Mikel Nov 20 '21 at 13:52
  • **HLS Downloader isn't safe to use**. it asks to read data from all websites, ie your credit card, wallet details etc - it should just ask for permission on video sites. Don't use it. – mikemaccana Jul 15 '22 at 16:05
  • @mikemaccana I would suggest that you open an issue with the project concerning what permission the extension needs on their [Github issues page](https://github.com/puemos/hls-downloader/issues). As I stated above in my answer it is an open source program so you can look at the code yourself and change it if you do not like it. I have not used the extension now for a long time, so I am unsure what permissions it asks for and as to why. – frederickjh Jul 16 '22 at 17:36
  • New url - HLS Downloader - https://chrome.google.com/webstore/detail/hls-downloader/fopnhepeflgcnppklfnejokkkeomdgik – KingRider Apr 04 '23 at 17:00
  • 1
    Thanks @KingRider, I updated the link above in my answer. – frederickjh Apr 06 '23 at 07:17
71

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
Benjamin Loison
  • 3,782
  • 4
  • 16
  • 33
slm
  • 15,396
  • 12
  • 109
  • 124
  • 1
    Note that this extension cost $25 to use, Video DownloadHelper is free and probably works for most scenarios. – Sire Oct 03 '22 at 10:19
58

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

idrositis
  • 1,136
  • 10
  • 10
  • 3
    Great tip! It seems that there's no need to download the `m3u8` file - you can just paste the external url as the source. –  Oct 16 '18 at 03:11
  • 2
    on the network tab there's a secondary tab for "Media". it's easier to get the m3u8 file from just a few items. – pcarvalho Feb 09 '20 at 17:05
  • 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"... – Canelo Digital Aug 01 '20 at 03:30
  • 2
    Not found any m3u8 file in `developer tools` in chrome. Any suggestion? Thanks – Kamlesh Aug 09 '21 at 18:06
  • 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. – Wiktor Stribiżew Aug 28 '21 at 12:55
  • These steps need much more detail to follow. – 2540625 Dec 31 '21 at 22:00
53

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

chiappa
  • 1,298
  • 10
  • 21
50

If you can NOT find the .m3u8 file you will need to do a couple of steps different.

1) Go to the network tab and sort by Media

Sort by media

2) You will see something here and select the first item. In my example, it's an mpd file. then copy the Request URL.

3) Next, download the file using your favorite command line tool using the URL from step 2.

youtube-dl -f bestvideo+bestaudio https://url.com/destination/stream.mpd

4) Depending on the encoding you might have to join the audio and video files together but this will depend on a video by video case.

Rick
  • 12,606
  • 2
  • 43
  • 41
27
  1. Find the playlist/manifest with the developer tools network tab. There is always one, as that's how it works. It might have an m3u8 extension that you can type into the Filter. (The youtube-dl tool can also find the m3u8 tool automatically some time give it a direct link to the webpage where the video is being displayed.)
  2. Give it to the youtube-dl tool (Download). It can download much more than just YouTube. It'll auto-download each segment then combine everything with FFmpeg then discard the parts. There is a good chance it supports the site you want to download from natively, and you don't even need to do step #1.
  3. If you find a site that is stubborn and you run into 403 errors... Telerik Fiddler to the rescue. It can catch and save anything transmitted (such as the video file) as it acts as a local proxy. Everything you see/hear can be downloaded, unless it's DRM content like Spotify.

Note: in the window, you can use youtube-dl.exe using "Command Prompt" or creating a batch file. i.e

Thanks

Tushar Shukla
  • 5,666
  • 2
  • 27
  • 41
23

I posted this already at some other websites and though why not share it with guys/gals at stackoverflow.

  1. Install the Video DownloadHelper extension on Firefox browser.
  2. With DownloadHelper activated, navigate to the webpage containing the video that you want to download.
  3. Once the video is streaming, click on the DownloadHelper icon. It will give you a list of all file formats available on the current video.
  4. Scroll onto the file format that you wish to download
  5. On the right hand side, you will see an arrow
  6. Click on that arrow to get more information regarding the current video and the selected format
  7. From the displayed window at the end of that arrow, scroll down and select "Details"
  8. You now have all the details concerning the current video and the selected format. It is something like this.

Hit Details⊗ _needsAggregate _needsCoapp actions bitrate chunked descrPrefix durationFloat extension frameId fromCache group
hls id isPrivate length masterManifest mediaManifest originalId referrer size status title topUrl url urlFilename

  1. Now, look at the specifics of the referrer in that Hit Details. That's the url you want. Copy it and paste on your favorite downloader.
Johny Flodder
  • 349
  • 2
  • 2
  • 7
    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) – godblessstrawberry Aug 03 '20 at 13:42
  • 1
    @godblessstrawberry Thanks! You should post this as an answer. – Ryan Jan 07 '21 at 06:17
  • Hello, this don't work with events.on24, but it's a great extension, helped me a lot – André M. Faria Feb 25 '21 at 17:35
  • 1
    @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 Aug 09 '21 at 18:03
  • @Kamlesh maybe this could help https://stackoverflow.com/a/55071769/1665293 – godblessstrawberry Aug 27 '21 at 09:37
  • Thanks @godblessstrawberry I have already visited this solution, not solved my problem yet, thanks again. – Kamlesh Sep 01 '21 at 06:42
0

If the blob is instantiated with data from an F4M manifest (check the Network Tab in Chrome's Developer Tools), you can download the video file using the php script posted here: https://n1njahacks.wordpress.com/2015/01/29/how-to-save-hds-flash-streams-from-any-web-page/

By putting:

  if ($manifest == '')
    $manifest = $_GET['manifest'];

before:

  if ($manifest)

you could even run it on a webserver, using requests with the query string: ?manifest=[manifest url].

Note that you'll probably want to use an FTP client to retrieve the downloaded video file and clean up after the script (it leaves all the downloaded video parts).

Protector one
  • 6,926
  • 5
  • 62
  • 86