我想下载一个视频,它的URL不是一个简单的MP4文件,而是一个blob类型的例子:
<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>
有没有任何chrome扩展或软件,可以用来从blob url下载视频?
我刚刚想出了一个通用的解决方案,这应该适用于大多数网站。
我只在Chrome上尝试了这个方法,但这个方法应该适用于任何其他浏览器,因为Dev Tools在它们中几乎是相同的。
步骤:
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.
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).
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.
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.
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.
使用HLS Downloader谷歌Chrome扩展来获得链接到M3U播放列表。它在浏览器栏中的图标将显示当前网页上找到的播放列表的数量。点击图标,然后可以看到播放列表链接的列表,然后使用链接旁边的复制按钮复制它。
然后使用youtube-dl程序下载该文件。
youtube-dl --all-subs -f mp4 -o "file-name-to-save-as.mp4" "https://link-from-Google_Chrome-HLS_Downloader_extension"
命令行选项说明:
-f mp4 =输出格式mp4
——all-subs =下载所有字幕
-o "file- Name -to-save-as.mp4" =要保存视频的文件名。
“https://link-from-Google_Chrome-HLS_Downloader_extension”=这是从HLS Downloader扩展复制的播放列表的链接。
如果您一直在为youtube-dl使用相同的配置选项,那么您可能希望查看youtube-dl的配置选项,因为这可以为您节省大量输入。
HLS Downloader扩展在MIT许可下是免费和开源的,如果你想看代码,可以在Github上的项目页面上找到。
我刚刚想出了一个通用的解决方案,这应该适用于大多数网站。
我只在Chrome上尝试了这个方法,但这个方法应该适用于任何其他浏览器,因为Dev Tools在它们中几乎是相同的。
步骤:
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.
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).
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.
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.
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.
如果blob实例化的数据来自一个F4M清单(检查网络选项卡在Chrome的开发工具),你可以下载视频文件使用php脚本发布在这里:https://n1njahacks.wordpress.com/2015/01/29/how-to-save-hds-flash-streams-from-any-web-page/
通过将:
if ($manifest == '')
$manifest = $_GET['manifest'];
之前:
if ($manifest)
你甚至可以在web服务器上运行它,使用带有查询字符串的请求:?manifest=[manifest url]。
注意,您可能需要使用FTP客户端来检索下载的视频文件并在脚本之后清理(它会留下所有下载的视频部分)。