如何获取youtube任意视频的数据流链接?
我不确定这是否是发布这个问题的正确位置,我用谷歌搜索了很多关于这个问题的信息,但什么也没有出现。对于表单的链接
http://www.youtube.com/watch?v=[video_id]
如何获取数据流的链接?
I'm not sure if this is the right place to post this question,I googled a lot about this,but nothing turned up,. for a link of the form
http://www.youtube.com/watch?v=[video_id]
How do i get the link for the data stream?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
以下 bash 脚本将检索 youtube 流媒体 url。我知道这已经过时了,但也许这会对某人有所帮助。
The following bash script will retrieve youtube streaming url's. I know this is outdated, but maybe this will help someone.
以下是有关对 YouTube 页面进行逆向工程以提取流数据的快速课程。
在 HTML 中,您会发现一个
该代码段后面的引号中的文本是显示 Flash 对象的 HTML。 请注意,此文本是一组连接在一起的分解字符串,因此您需要对其进行清理(即删除 '" + "' 的实例以及转义反斜杠以获得 HTML字符串。)
清理后,您需要找到 ;标记 与 name="flashvars",此标记的值是一个 & 分隔的 URL。对 & 进行拆分您将获得与该视频相关的所有数据的键值对。
您要查找的主要键是“fmt_url_map”,它是一个以“35|”开头的逗号分隔值的 URL 编码字符串。或“34|”或其他。 (这些在另一个键“fmt_list”中定义为分辨率为 854x480(35)、640x360(34)的文件,等等。)
Here's a quick lesson in reverse-engineering the YouTube page to extract the stream data.
In the HTML you'll find a <script> tag which defines a variable "swfHTML" - it looks like this: "var swfHTML = (isIE) ? "...
The text in the quotes that follows that snippet is the HTML that displays the Flash object. Note, this text is a set of broken up strings that get concatenated so you'll need to clean it up (i.e. strip instances of '" + "' and and escaping backslashes in order to get the HTML string.)
Once clean you'll need to find the <param> tag with name="flashvars", the value of this tag is an &-delimited URL. Do a split on the & and you'll get your key-value pairs for all the data relating to this video.
The main key you're looking for is "fmt_url_map" and it's an URL Encoded string of Comma-Separated Values starting with "35|" or "34|" or other. (These are defined in another key, "fmt_list" to be files of resolution 854x480 for 35, 640x360 for 34, etc..)
每个频道都提供RSS数据,但不会立即更新。
这是 Youtube RSS 文件的生成器。您应该能够根据 RSS 信息推断出视频文件的位置。 flv 文件应该是可流式传输的,但也提供其他格式。
编辑:
http://www.referd.info/
不再可用。它基本上是一项服务,您可以在其中提供 YouTube 链接,然后取消引用,找到该视频的所有可能的下载源。我确信这些服务仍然存在......这个已经不复存在了。each channel provides rss-data, wich is not updated immediatelly.
Here is a generator for Youtube RSS Files. You should be able to deduce the location of videofiles based on the RSS information. The flv files should be streamable but other formats are also provided.
EDIT:
http://www.referd.info/
is no longer available. It basically was a service where you provided the youtube link and it dereferenced it found all possible downloadsources for that video. I am sure those services are still out there... this one isnt anymore.你需要像这样打开链接
http://www.youtube.com/get_video_info?&video_id=OjEG808MfF4
并找到您的流返回数据
You Need Open Link Like This
http://www.youtube.com/get_video_info?&video_id=OjEG808MfF4
And Find Your Stream Your In Return Data