如何在浏览器中使用F12工具下载嵌入式视频

时间:2024-03-26 10:41:10

I got an email this week asking how to download some of my Azure Friday video podcast videos from http://friday.azure.com as well as some of the Getting Started Videos from Azure.com.

本周我收到一封电子邮件,询问如何从http://friday.azure.com下载我的某些Azure Friday视频播客视频以及从Azure.com下载一些入门视频

NOTE: Respect copyright and consider what you’re doing and WHY before you use this technique to download videos that may have been embedded for a reason.

注意:在使用此技术下载可能由于某种原因嵌入的视频之前,请尊重版权并考虑您的工作状况和原因。

I told them to download the videos with F12 tools, and they weren't clear how. I'll use an Azure Friday video for the example. Do be aware that there are a ton of ways to embed video on the web and this doesn't get around ones that REALLY don't want to be downloaded. This won't help you with Netflix, Hulu, etc.

我告诉他们使用F12工具下载视频,但不清楚如何。 我将以Azure星期五视频为例。 注意,有很多方法可以将视频嵌入到网络中,而这并不能绕过那些真的不想下载的视频。 这对Netflix,Hulu等无济于事。

First, I'll visit the site with the video I want in my browser. I'll use Chrome but this also works in Edge or Firefox with slightly different menus.

首先,我将在浏览器中播放想要的视频,并访问该网站。 我将使用Chrome,但这在Edge或Firefox中也可以使用,菜单略有不同。

Then press F12 to bring up the Developer Tools pane and click Network. In Edge, click Content Type, then Media.

然后按F12弹出“开发人员工具”窗格,然后单击“网络”。 在“边缘”中,单击“内容类型”,然后单击“媒体”。

如何在浏览器中使用F12工具下载嵌入式视频

Click the "clear" button to set up your workspace. That's the International No button there in the Network pane. Now, press Play and get ready.

单击“清除”按钮以设置您的工作区。 这是“网络”窗格中的“国际无”按钮。 现在,按Play并准备。

Look in the Media list for something like ".mp4" or something that looks like the video you want. It'll likely have an HTTP Response in the 20x range.

在“媒体”列表中查找“ .mp4”之类的内容或类似于您想要的视频的内容。 它的HTTP响应可能在20倍范围内。

如何在浏览器中使用F12工具下载嵌入式视频

In Chrome, right click on the URL and select Copy as CURL. If you're on Windows pick cmd.exe and bash if you're on Linux/Mac.

在Chrome浏览器中,右键单击URL,然后选择“复制为CURL”。 如果您使用Windows,请选择cmd.exe,如果使用Linux / Mac,请选择bash。

如何在浏览器中使用F12工具下载嵌入式视频

You'll get a crazy long command put into your clipboard. It's not all needed but it's a very convenient feature the browser provides, so it's worth using.

您会在剪贴板中输入疯狂的长命令。 并不需要全部,但这是浏览器提供的非常方便的功能,因此值得使用。

Get Curl: If you don't have the "curl" command you'll want to download "curl.exe" from here https://curl.haxx.se/dlwiz/ and, if you like, put it in your PATH. If you have Windows, get the free bundled curl version with installer here.

获取Curl:如果没有“ curl”命令,则要从此处https://curl.haxx.se/dlwiz/下载“ curl.exe”,如果愿意,可以将其放在PATH中。 如果您使用的是Windows,请在此处免费获取带有安装程序的捆绑curl版本

Open a terminal/command prompt - run cmd.exe on Windows - and paste in the command. If the browser you're using only gives you the URL and not the complete "curl" command, the command you're trying to build is basically curl [url] -o [outputfile.mp4]. It's best if you can get the complete command like the one Chrome provides, as it may include authentication cookies or other headers that omitting may prevent your download from working.

打开终端/命令提示符-在Windows上运行cmd.exe-并粘贴命令。 如果您使用的浏览器仅提供URL,而不提供完整的“ curl”命令,则您尝试构建的命令基本上是curl [url] -o [outputfile.mp4]。 最好获取与Chrome浏览器一样的完整命令,因为它可能包含身份验证Cookie或其他标头,如果省略这些标头,可能会阻止您的下载工作。

GOTCHA: Make sure to remove the -H "Range:" headers (if any) to ensure you get the FULL download and not just a range of bytes!

GOTCHA :确保删除-H“ Range:”标头(如果有的话),以确保获得FULL下载,而不仅仅是字节范围!

如何在浏览器中使用F12工具下载嵌入式视频

BEFORE you press enter, make sure you add "-o youroutputfilename.mp4." Also, if you can an error about security and certificates, you may need to add "--insecure."

在按Enter键之前,请确保添加“ -o youroutputfilename.mp4”。 另外,如果您可能遇到有关安全性和证书的错误,则可能需要添加“ --insecure”。

如何在浏览器中使用F12工具下载嵌入式视频

In the screenshot above I'm saving the file as "test.mp4" on my desktop.

在上面的屏幕截图中,我将文件另存为“ test.mp4”。

There are several ways to download embedded videos, including a number of online utilities that come and go, but this technique has been very reliable for me.

有几种下载嵌入式视频的方法,包括许多在线实用程序,但是这种技术对我来说非常可靠。



Sponsor: Scale your Python for big data & big science with Intel® Distribution for Python. Near-native code speed. Use with NumPy, SciPy & scikit-learn. Get it Today

赞助商:借助适用于Python的英特尔®发行版,将Python扩展到大数据和大科学领域。 接近本机的代码速度。 与NumPy,SciPy和scikit-learn一起使用。 立即获取

关于斯科特(About Scott)

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。

如何在浏览器中使用F12工具下载嵌入式视频
如何在浏览器中使用F12工具下载嵌入式视频
如何在浏览器中使用F12工具下载嵌入式视频
About   关于 Newsletter 时事通讯
Hosting By 主持人
如何在浏览器中使用F12工具下载嵌入式视频

翻译自: https://www.hanselman.com/blog/how-to-download-embedded-videos-with-f12-tools-in-your-browser