YouTube에서 비디오를 다운로드하고 싶습니다. 나는 IDM에서 링크 위에 있어요YouTube에서 비디오 다운로드 링크를 얻는 방법은 무엇입니까?
http://www.youtube.com/watch?v=Fwa_GvIBH38&feature=feedrec_grec_index
http://o-o.preferred.btcl-dac1.v6.lscache4.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Calgorithm%2Cburst%2Cfactor%2Ccp&fexp=914016%2C904443&algorithm=throttle-factor&itag=34&ip=58.0.0.0&burst=40&sver=3&signature=82D07EBDBED8BC79D08AEE3F90B1473E44D4065E.88AB21BBB9E2D252B65FE6C419CD7867CDE8815C&source=youtube&expire=1322694000&key=yt1&ipbits=8&factor=1.25&cp=U0hRR1ZUUl9FSkNOMV9OTlZBOmRXLUt2VHYwWVY2&id=1706bf1af2011f7f&ptchn=collegehumor&ptk=collegehumor
에 도착합니다.
위의 링크를 얻으려면 웹 사이트에서 두 가지 방법이 있습니다.
//this methods get's the download link for youtube videos in mp4 format.
public string url(string url)
{
string html = getYoutubeHtml(url);
HtmlAgilityPack.HtmlDocument hDoc = new HtmlDocument();
hDoc.LoadHtml(html);
HtmlNode node = hDoc.GetElementbyId("movie_player");
string flashvars = node.Attributes[5].Value;
string _url = Uri.UnescapeDataString(flashvars);
string[] w = _url.Split('&');
string link = "";
bool foundUrlMap = false;
for (int i = 0; i < w.Length; i++)
{
if (w[i].Contains("fmt_url_map="))
{
foundUrlMap = true;
link += w[i].Split('|')[1];
}
if (foundUrlMap)
{
//add the parameters to the url
link += "&" + w[i];
if (w[i].Contains("id="))
{
link = link.Split(',')[0];
//change the array index for different formats
break;
}
}
}
link = link.Split('|')[1] + "&title=out";
System.Windows.MessageBox.Show(link);
return link;
}
//this method downloads the html code from the youtube page.
private string getYoutubeHtml(string url)
{
string html = "";
WebRequest request = WebRequest.Create(url);
WebResponse response = request.GetResponse();
TextReader reader = new StreamReader(response.GetResponseStream());
string line = "";
while ((line = reader.ReadLine()) != null)
{
html += line;
}
return html;
}
그것은 내가 무엇을 할 수 지금 그래서
승의 내부 fmt_url_map=
을 찾을 수없는
을 work.ing 아니에요?
([이 질문의 대답] 변환 시도 http://stackoverflow.com/questions/6015962/how- 웹 클라이언트에서 직접 스트림을로드 to-get-mp4-mov-m4v-video-link-for-a-youtube-video)를 C# – Blender
에 보내면 해결책이 작동하지 않습니다. – Vero009
당신이 그것을 변환? – Blender