[英]How to extract all the current video files and its address in the web page with js?
var imgs=document.images.length;
It can extract all the images on the web page. 它可以提取网页上的所有图像。
How extract all the flv files whose suffix is flv such as sample.flv
in the web page with js?Not all the flv files on my local directory but web page. 如何使用js在网页中提取所有后缀为flv的flv文件,例如sample.flv
?不是我本地目录中的所有flv文件而是网页。
The plugin Video DownloadHelper
in firefox can get the current mp4 file. firefox中的插件Video DownloadHelper
可以获取当前的mp4文件。
Why my js code can't do the same task? 为什么我的js代码不能执行相同的任务?
var Links = document.querySelectorAll('a[href$=".mp4"]');
console.log(Links);
How to extract the current video files with js such as the plugin Video DownloadHelper
in firefox? 如何用fires中的插件Video DownloadHelper
等js提取当前视频文件?
Yahoo Movies use blob stream to transfer video data. 雅虎电影使用blob流传输视频数据。 There are no direct mp4/flv
links anywhere, nor can you get such links directly. 在任何地方都没有直接的mp4/flv
链接,也不能直接获得这样的链接。 The src
of the <video>
tag refers to a blob stream link: <video>
标记的src
引用blob流链接:
<video class="yvp-html5-video" preload="" id="2413371376" src="blob:https://www.yahoo.com/1dfafd99-a1ff-4cc8-bcff-255e69db9977"></video>
When you hit to download MP4 from Video DownloadHelper
, the plugin actually reads the blob stream and writes it to disk in an MP4 file. 当您从Video DownloadHelper
下载MP4时,该插件实际上会读取blob流并将其写入MP4文件中的磁盘。 It doesn't download a MP4 file. 它不下载MP4文件。 If you try to Copy URL
, you'll get something like this to your clipboard: 如果你尝试Copy URL
,你会得到这样的东西给你的剪贴板:
https://roarack01.vpg.cdn.yimg.com/yahoomovies/61fb473f-04a2-381e-b2ae-9496dfba5e66_VYtMtix1DscECbXMT9tHT7yf2P9BZF-mRCMjBejFgALFHl7NSm1ZXPOMICAOr949v2xUgEASYLw-_1_0_vtt.m3u8?a=yahoomovies&ib=sapi&m=application%2fvnd.apple.mpegurl&mr=0&ns=c+i+ci+cii&vid=61fb473f-04a2-381e-b2ae-9496dfba5e66&x=1479599999&s=370695a7063b6aae06fb7f537c85773a
You can record a blob stream, but it's not an easy task. 您可以录制blob流,但这不是一件容易的事。
For more details on video blob stream, check these links: 有关视频blob流的更多详细信息,请查看以下链接:
What is blob in the <video src=blob:url>? <video src = blob:url>中的blob是什么?
Export HTML5 blob video to MP4 将HTML5 blob视频导出到MP4
If I'm understanding correctly you want to look for all the links which have an associated .flv
. 如果我正确理解你想要查找所有具有相关联的.flv
的链接。
If you want this, you can use querySelectorAll and select all the links ending in .flv using the css selector $=
. 如果需要,可以使用querySelectorAll并使用css选择器$=
选择以.flv结尾的所有链接。
var flvLinks = document.querySelectorAll('a[href$=".flv"]');
to get all flv files of a directory, please try the following code - 要获取目录的所有flv文件,请尝试以下代码 -
var files = fs.readdirSync("YOUR_DIRECTORY");
var path = require('path');
for(var i in files) {
if(path.extname(files[i]) === ".flv") {
//do your desired task here
}
}
Hope it helps..:) 希望能帮助到你..:)
您可以在媒体子标签中的Chrome - >网络标签上检查所有视频请求。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.