Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get a video download link from YouTube?
    text
    copied!<p>I want to download videos from YouTube. I want to get </p> <pre><code>http://www.youtube.com/watch?v=Fwa_GvIBH38&amp;feature=feedrec_grec_index </code></pre> <p>To</p> <pre><code>http://o-o.preferred.btcl-dac1.v6.lscache4.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Csource%2Calgorithm%2Cburst%2Cfactor%2Ccp&amp;fexp=914016%2C904443&amp;algorithm=throttle-factor&amp;itag=34&amp;ip=58.0.0.0&amp;burst=40&amp;sver=3&amp;signature=82D07EBDBED8BC79D08AEE3F90B1473E44D4065E.88AB21BBB9E2D252B65FE6C419CD7867CDE8815C&amp;source=youtube&amp;expire=1322694000&amp;key=yt1&amp;ipbits=8&amp;factor=1.25&amp;cp=U0hRR1ZUUl9FSkNOMV9OTlZBOmRXLUt2VHYwWVY2&amp;id=1706bf1af2011f7f&amp;ptchn=collegehumor&amp;ptk=collegehumor </code></pre> <p>I got above link from IDM.</p> <p>I got two methods from a web site to get above link.</p> <pre><code> //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('&amp;'); string link = ""; bool foundUrlMap = false; for (int i = 0; i &lt; 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 += "&amp;" + w[i]; if (w[i].Contains("id=")) { link = link.Split(',')[0]; //change the array index for different formats break; } } } link = link.Split('|')[1] + "&amp;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; } </code></pre> <p>It's not work.ing </p> <p>It does not find <code>fmt_url_map=</code>inside of <b>w</b> </p> <p>So now what can I do?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload