获得一个FLV从YouTube在.NET [英] Getting an FLV from YouTube in .NET

查看:216
本文介绍了获得一个FLV从YouTube在.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我书面方式FLV媒体播放器,并想知道是否有反正有访问从URL中使用由YouTube潜在的FLV文件?过去有一帮做这件事的方式,但YouTube上已经改变的事情有关,我现在找不到任何办法做这件事的......

I'm writting FLV media player and want to know if there is there anyway of accessing the underlying FLV files used by YouTube from a URL? There used to be a bunch of ways of doing it, but YouTube have changed things about and I now can't find any way of doing it...

这是我所看到的,到目前为止,YouTube的API似乎并没有给予任何访问权限。有没有人找到了一种方法做这件事的?

From what I've seen so far, the YouTube API doesn't seem to give access either. Has anyone found a way of doing it?

干杯!

推荐答案

有两次与YouTube视频关联的值:一个ID和一个签名。该ID是简单的获得,因为它是在URI本身。签名是有点麻烦就搞定了。它嵌入在每个视频页面的源$ C ​​$ C一个JavaScript语句。

There are two values associated with a YouTube video: an ID and a signature. The ID is simple to get, as it's in the URI itself. The signature is a bit trickier to get. It's embedded in a Javascript statement in the source code of each video page.

例如,让我们的沼沼的视频。

For example, let's take the Numa Numa video.

KmtzQCSh6xk 的ID,这可以从以下URI中可以看出。

It has an ID of KmtzQCSh6xk, as can be seen from the URI.

要拿到签名,我们要挖成HTML源$ C ​​$ C。在Firefox中很容易做到这一点,右键单击页面上的任何位置加载该页面的源,然后单击查看页面源代码。在此之后,preSS按Ctrl + F,然后键入T:。它会带你到页面的签名:数值后直接在报价是签名

To get the signature, we have to dig into the source code of the HTML. To easily do this in Firefox, load the source of the page by right clicking anywhere on the page and click "View Page Source." After that, press Ctrl+F, and type in "t":. It will take you to the signature of the page: the value directly after that in quotes is the signature.

在沼沼舞的情况下,它的签名是 vjVQa1PpcFOSvCcjdAYSc3ZQgK-6EG9yQM7RLSYqJk4%3D

In the case of the Numa Numa Dance, it's signature is vjVQa1PpcFOSvCcjdAYSc3ZQgK-6EG9yQM7RLSYqJk4%3D

要获得实际FLV,你进入这个网址:

To get the actual FLV, you enter this URI:

http://www.youtube.com/get_video?fmt=5&video_id= {ID}& T公司= {签名}

完整的URI来获取FLV视频:

The complete URI to get the FLV video is:

<一个href="http://www.youtube.com/get%5Fvideo?fmt=5&video%5Fid=KmtzQCSh6xk&t=vjVQa1PpcFOSvCcjdAYSc3ZQgK-6EG9yQM7RLSYqJk4%3D" rel="nofollow"><$c$c>http://www.youtube.com/get_video?fmt=5&video_id=KmtzQCSh6xk&t=vjVQa1PpcFOSvCcjdAYSc3ZQgK-6EG9yQM7RLSYqJk4%3D

您可以使用这些信息来帮助你得到你需要下载FLV编程的签名和身份证。无论是做一个简单的 String.Find 的值T:或使用正则表达式,它应该是简单的寻找,直到他们改变它。

You can use this information to help you get the signature and ID you need to download the FLV programatically. Whether it's doing a simple String.Find for the value "t": or using RegEx, it should be simple to find until they change it.

这篇关于获得一个FLV从YouTube在.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆