locked
Youtube Video Downloader RRS feed

  • Question

  • Hello I am make Online Video downloader so i Chose www.Youtube.com Video download But i get some error Please Helpme to Complete this Process
    (Youtube is the Basicaly Online Video Website who Containg FLV file Video)
     For starting Process we need Two Richtextboxs , One Textbox , Three Buttons , one Progressbar
    one webbrowser and Three Labels 
    look:


     

    Imports System.net
    Public Class Form1
          Private WithEvents download As WebClient
        Private Sub get_link()
    Dim i As Integer Dim l As Integer Dim string1 As Integer i = Me.rtb.Find("wath_fullscreen") l = Me.rtb.Find("&title") Me.rtb.Select(i, Me.rtb.Text.Length) Me.txturl.Text = Me.rtb.SelectedText.ToString Me.rtb.Select(l, Me.rtb.Text.Length) string1 = Me.rtb.SelectedText.ToString Me.txturl.Text = Me.txturl.Text.Replace(string1, "&")
    Me.txturl.Text = Me.txturl.Text.Insert(0, "http://www.youtube.com/get_video?") End Sub Private Sub done() Me.lbl_bytes.text = "0 Bytes of 0 Bytes" Me.lbl_title.text = "" Me.lbl_percent.text = "0 %" Me.ProgressBar1.Value = 0 Me.btn_cancel.Enabled = False Me.btn_download.enabled = False Me.btn_val.Enabled = True End Sub Private Sub btn_val_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_val.Click If Not Me.textbox1.Text = "" Then If Me.textbox1.Text.Contains("http://www.youtube.com/watch?v") Then Me.WebBrowser1.Navigate(Me.textbox1.Text) Else Form2.Show() End If Else MsgBox("") End If End Sub Private Sub download_DownloadDataCompleted(ByVal sender As Object, ByVal e As System.Net.DownloadDataCompletedEventArgs) Handles download.DownloadDataCompleted done() MsgBox("Video Download Is Succesful", MsgBoxStyle.OkOnly) End Sub Private Sub download_DownloadProgressChanged(ByVal sender As Object, ByVal e As System.Net.DownloadProgressChangedEventArgs) Handles download.DownloadProgressChanged Me.ProgressBar1.Value = e.ProgressPercentage Me.lbl_percent.Text = e.ProgressPercentage Me.lbl_bytes.Text = e.BytesReceived & "bytes of" & e.TotalBytesToReceive End Sub Private Sub btn_download_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_download.Click get_link() Dim save As New SaveFileDialog save.Title = "Choose where to save the video" save.Filter = "Flv|*.flv;*.flv" save.FileName = Me.lbl_title.Text & ".flv" save.ShowDialog() Me.btn_cancel.Enabled = True Me.btn_val.Enabled = False Me.btn_download.Enabled = False download = New WebClient Dim url = txturl.Text Dim wheretosave = save.FileName Me.ProgressBar1.Value = 0 Me.ProgressBar1.Maximum = 100 Try download.DownloadFileAsync(New Uri(url), (wheretosave)) Catch ex As Exception MsgBox("Cannot download video, Please check your Video link") End Try End Sub Private Sub btn_cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_cancel.Click download.CancelAsync() MsgBox("Cancel Download", MsgBoxStyle.OkOnly, "Cancel") done() End Sub Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated If Me.WebBrowser1.Url.ToString.Contains("http://www.youtube.com/watch?v") Then Me.lbl_title.Text = Me.WebBrowser1.DocumentTitle Me.lbl_title.Text = Me.lbl_title.Text.Replace("YouTube - ", "") Me.rtb.Text = Me.WebBrowser1.DocumentText Me.WebBrowser1.Navigate("about:blank") Me.btn_download.Enabled = True End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Opacity = 0 Timer1.Interval = TotalDelayInMS / StepInMS Timer1.Enabled = True Me.btn_download.Enabled = False Me.lbl_title.Text = "" Me.btn_cancel.Enabled = False End Sub End Class
    • Edited by Shariq Ayaz Saturday, December 5, 2009 12:13 AM
    Saturday, September 5, 2009 2:41 PM

Answers

  • Hi,

    Look the reason that you are getting the Error is becase You-Tube have changed there download systems.
    Believe Me I Know, I have already made this particular type of software and had to change my download methord recently.

    All I can say to help you is that if you visit ANY Youtube page and rick click and select 'View Source', in the code you will see the following ....

    var MSG_Hide = 'Hide';
    		var MSG_Show = 'Show';
    		var MSG_Login = 'Please sign in to perform this operation.';
    		var MSG_Loading = 'Loading...';
    		var MSG_ShowingAll = 'Showing All Videos';
    		var MSG_LoginFavorites = 'You must be logged in to add this video to your favourites';
    		var MSG_LoginAddPlaylist = 'You must be logged in to add this video to a playlist.';
    		var MSG_LoginReportConcern = 'You must be logged in to report a concern.';
    		var MSG_FlagDefault = 'Select a Reason';
    
    			var swfUrl = canPlayV9Swf() ? "http://s.ytimg.com/yt/swf/watch-vfl119857.swf" : "http://s.ytimg.com/yt/swf/watch_v8-vfl119857.swf";
    
    
    		var swfArgs = {"rv.2.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdRGX2ylid_s%2Fdefault.jpg", "rv.7.length_seconds": "149", "rv.0.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpLk598kDTYk", "rv.0.view_count": "11194", "rv.2.title": "Adebayor+Celebration+Infront+of+Arsenal+Fans", "rv.7.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FVzowC9MHNq0%2Fdefault.jpg", "rv.4.rating": "5.0", "length_seconds": "39", "rv.0.title": "Emmanuel+Adebayor+Celebration+against+Arsenal+Fans", "rv.7.title": "Ronaldinho+Gaucho+vs+Lionel+Messi+WHO+WILL+WIN%3F+-+29%2F06%2F2008", "rv.3.view_count": "12017", "rv.5.title": "Liverpool+4-2+Arsenal+Uefa+Champions+League+Quarter+Final+L2", "rv.0.length_seconds": "62", "rv.4.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FNgUlAFuADZI%2Fdefault.jpg", "fmt_url_map": "34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D34%26ipbits%3D0%26signature%3D8F2F83B37B0A1414079EF0B94911B2A09271B252.5A966660251C329A46FF5122A33AAC343D2C96D8%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7%2C5%7Chttp%3A%2F%2Fv2.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D5%26ipbits%3D0%26signature%3DC47F66E22C5422287181220855CAEE2BE7207EB8.93C452DC09997B1DA12A110250C730231905A0EC%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7", "rv.2.rating": "3.66666666667", "keywords": "Emmanuel%2CAdebayor%2CRuns%2CTo%2CCelebrated%2CHis%2CGoal%2CIn%2CFront%2COf%2CThe%2CArsenal%2CFans%2CMan%2CCity%2C4-1", "cr": "GB", "rv.1.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMyoKcu8bcNQ", "rv.6.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdlQs2FzjxNg%2Fdefault.jpg", "rv.3.length_seconds": "68", "rv.1.id": "MyoKcu8bcNQ", "rv.3.rating": "5.0", "rv.6.title": "Adebayor+FM+2008+Goal", "rv.7.id": "VzowC9MHNq0", "iv_storage_server": "http%3A%2F%2Fwww.google.com%2Freviews%2Fy%2F", "rv.1.title": "Man+City+-+Arsenal+%3A+Adebayor+Goal+%28Run+to+Arsenal+fans%29", "rv.1.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FMyoKcu8bcNQ%2Fdefault.jpg", "creator": "AllFootyVideos0910", "rv.0.rating": "4.62820512821", "feature": "popular", "watermark": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf", "rv.6.author": "Raul4HH", "rv.3.title": "Arsenal+-+10+Best+Goals+2007%2F2008+--+8", "rv.5.id": "TYKXr_o23lQ", "rv.4.author": "footballshirtculture", "rv.1.view_count": "39002", "rv.0.id": "pLk598kDTYk", "iv_module": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fiv_module-vfl119825.swf", "rv.5.rating": "1.81935483871", "rv.4.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNgUlAFuADZI", "sdetail": "f%3Apopular%2Cp%3A%2F", "rv.1.author": "AftonbladetChannel", "rv.1.rating": "4.11578947368", "rv.4.title": "Adidas+F50i+-+Every+Team+Needs+The+Spark", "rv.5.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FTYKXr_o23lQ%2Fdefault.jpg", "rv.5.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTYKXr_o23lQ", "rv.6.length_seconds": "22", "sourceid": "y", "rv.0.author": "Dabadiestkidalive1", "rv.3.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FaB9c8aomPgU%2Fdefault.jpg", "rv.2.author": "Gippa123", "rv.6.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdlQs2FzjxNg", "rv.7.rating": "4.37671232877", "rv.3.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaB9c8aomPgU", "fmt_map": "34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0", "hl": "en", "rv.7.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVzowC9MHNq0", "rv.2.view_count": "431", "rv.4.length_seconds": "91", "rv.4.view_count": "1309", "rv.2.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdRGX2ylid_s", "plid": "AARzddnKWUyWEV_s", "rv.5.length_seconds": "222", "rv.0.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FpLk598kDTYk%2Fdefault.jpg", "rv.7.author": "deathblade125", "sk": "NjRpdm6YlrdvlXwhHjKNZrRguk-fkCwMC", "rv.5.view_count": "91421", "sw": "0.05", "rv.1.length_seconds": "39", "rv.6.rating": "1.0", "rv.5.author": "sarahck3984", "vq": "medium", "rv.3.id": "aB9c8aomPgU", "rv.2.id": "dRGX2ylid_s", "rv.2.length_seconds": "14", "t": "vjVQa1PpcFPi0WzmPLoi8nNn5wgjOnXPSvmkY-j5nrA%3D", "rv.6.id": "dlQs2FzjxNg", "video_id": "Vjlww0gMEOc", "rv.6.view_count": "475", "rv.3.author": "BeliarTheCursed", "rv.4.id": "NgUlAFuADZI", "rv.7.view_count": "234574"};
    		var watchGamUrl = null;
    		var watchDCUrl = null;
    		var expressInstallUrl = null;

    You need to EXTRACT the following line:

    var swfArgs = {"rv.2.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdRGX2ylid_s%2Fdefault.jpg", "rv.7.length_seconds": "149", "rv.0.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpLk598kDTYk", "rv.0.view_count": "11194", "rv.2.title": "Adebayor+Celebration+Infront+of+Arsenal+Fans", "rv.7.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FVzowC9MHNq0%2Fdefault.jpg", "rv.4.rating": "5.0", "length_seconds": "39", "rv.0.title": "Emmanuel+Adebayor+Celebration+against+Arsenal+Fans", "rv.7.title": "Ronaldinho+Gaucho+vs+Lionel+Messi+WHO+WILL+WIN%3F+-+29%2F06%2F2008", "rv.3.view_count": "12017", "rv.5.title": "Liverpool+4-2+Arsenal+Uefa+Champions+League+Quarter+Final+L2", "rv.0.length_seconds": "62", "rv.4.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FNgUlAFuADZI%2Fdefault.jpg", "fmt_url_map": "34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D34%26ipbits%3D0%26signature%3D8F2F83B37B0A1414079EF0B94911B2A09271B252.5A966660251C329A46FF5122A33AAC343D2C96D8%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7%2C5%7Chttp%3A%2F%2Fv2.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D5%26ipbits%3D0%26signature%3DC47F66E22C5422287181220855CAEE2BE7207EB8.93C452DC09997B1DA12A110250C730231905A0EC%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7", "rv.2.rating": "3.66666666667", "keywords": "Emmanuel%2CAdebayor%2CRuns%2CTo%2CCelebrated%2CHis%2CGoal%2CIn%2CFront%2COf%2CThe%2CArsenal%2CFans%2CMan%2CCity%2C4-1", "cr": "GB", "rv.1.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMyoKcu8bcNQ", "rv.6.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdlQs2FzjxNg%2Fdefault.jpg", "rv.3.length_seconds": "68", "rv.1.id": "MyoKcu8bcNQ", "rv.3.rating": "5.0", "rv.6.title": "Adebayor+FM+2008+Goal", "rv.7.id": "VzowC9MHNq0", "iv_storage_server": "http%3A%2F%2Fwww.google.com%2Freviews%2Fy%2F", "rv.1.title": "Man+City+-+Arsenal+%3A+Adebayor+Goal+%28Run+to+Arsenal+fans%29", "rv.1.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FMyoKcu8bcNQ%2Fdefault.jpg", "creator": "AllFootyVideos0910", "rv.0.rating": "4.62820512821", "feature": "popular", "watermark": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf", "rv.6.author": "Raul4HH", "rv.3.title": "Arsenal+-+10+Best+Goals+2007%2F2008+--+8", "rv.5.id": "TYKXr_o23lQ", "rv.4.author": "footballshirtculture", "rv.1.view_count": "39002", "rv.0.id": "pLk598kDTYk", "iv_module": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fiv_module-vfl119825.swf", "rv.5.rating": "1.81935483871", "rv.4.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNgUlAFuADZI", "sdetail": "f%3Apopular%2Cp%3A%2F", "rv.1.author": "AftonbladetChannel", "rv.1.rating": "4.11578947368", "rv.4.title": "Adidas+F50i+-+Every+Team+Needs+The+Spark", "rv.5.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FTYKXr_o23lQ%2Fdefault.jpg", "rv.5.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTYKXr_o23lQ", "rv.6.length_seconds": "22", "sourceid": "y", "rv.0.author": "Dabadiestkidalive1", "rv.3.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FaB9c8aomPgU%2Fdefault.jpg", "rv.2.author": "Gippa123", "rv.6.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdlQs2FzjxNg", "rv.7.rating": "4.37671232877", "rv.3.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaB9c8aomPgU", "fmt_map": "34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0", "hl": "en", "rv.7.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVzowC9MHNq0", "rv.2.view_count": "431", "rv.4.length_seconds": "91", "rv.4.view_count": "1309", "rv.2.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdRGX2ylid_s", "plid": "AARzddnKWUyWEV_s", "rv.5.length_seconds": "222", "rv.0.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FpLk598kDTYk%2Fdefault.jpg", "rv.7.author": "deathblade125", "sk": "NjRpdm6YlrdvlXwhHjKNZrRguk-fkCwMC", "rv.5.view_count": "91421", "sw": "0.05", "rv.1.length_seconds": "39", "rv.6.rating": "1.0", "rv.5.author": "sarahck3984", "vq": "medium", "rv.3.id": "aB9c8aomPgU", "rv.2.id": "dRGX2ylid_s", "rv.2.length_seconds": "14", "t": "vjVQa1PpcFPi0WzmPLoi8nNn5wgjOnXPSvmkY-j5nrA%3D", "rv.6.id": "dlQs2FzjxNg", "video_id": "Vjlww0gMEOc", "rv.6.view_count": "475", "rv.3.author": "BeliarTheCursed", "rv.4.id": "NgUlAFuADZI", "rv.7.view_count": "234574"};
    
    And get your software to download the URL located within ...

    Eg.

    34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D34%26ipbits%3D0%26signature%3D8F2F83B37B0A1414079EF0B94911B2A09271B252.5A966660251C329A46FF5122A33AAC343D2C96D8%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7%2C5%7C

    Please note that the enclosed URL shown above odviously won't work because characters like '%2F' actually stand for '/'.
    You would need to write some code to change these to the correct letter values.

    Hope this helps,
    DJ PIP
    • Proposed as answer by DJ PIP Sunday, September 13, 2009 1:57 PM
    • Marked as answer by Shariq Ayaz Sunday, September 20, 2009 2:16 AM
    Sunday, September 13, 2009 1:57 PM
  • Imports System.Net
    Imports System.IO
    
    Public Class Form1
    
        Public request As HttpWebRequest
        Public response As HttpWebResponse
        Public source As String
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            request = DirectCast(HttpWebRequest.Create("http://www.youtube.com/watch?v=hwQdGY6JuDY"), HttpWebRequest)
            response = DirectCast(request.GetResponse, HttpWebResponse)
            source = New StreamReader(response.GetResponseStream, System.Text.Encoding.Default).ReadToEnd
    
            If source.IndexOf("video_id") > -1 Then
                'This grabs the .flv location URL ready for doownloading.
                Dim signature As String = source
                signature = System.Text.RegularExpressions.Regex.Split(signature, (ChrW(34) + "fmt_url_map" + ChrW(34) + ": " + ChrW(34)))(1)
                'This changes the URL to conform to internet standards eg. %20 = " "
                signature = signature.Remove(0, 5)
                signature = signature.Replace("%252C", ",")
                signature = signature.Replace("%2F", "/")
                signature = signature.Replace("%3D", "=")
                signature = signature.Replace("%3F", "?")
                signature = signature.Replace("%3A", ":")
                signature = signature.Replace("%26", "&")
                Dim sig2 As String = signature
                sig2 = sig2.IndexOf("http", 30)
                signature = signature.Remove(sig2, signature.Length - sig2)
                signature = signature.Remove(signature.IndexOf("%"), 7)
                'Removes any remaining % characters from the string.
                signature = signature.Replace("%", "")
                'Checks for and Removes any remaining C characters from the string.
                If signature.Chars(signature.Length - 1) = "C" Then
                    signature = signature.Remove(signature.Length - 1, 1)
                End If
                MsgBox("Here is the address to download the You-Tube Video:" + vbCrLf + signature.ToString())
            Else
                Msgbox("Error! Invalid URL?")
            End If
        End Sub
    
    End Class
    Create a new form and add 1 button.
    Odviously you need to implement the actual download of the video and the ability to select the video URL.
    Just change the video in the code for now.
    Hope this helps.

    DJ PIP
    • Proposed as answer by DJ PIP Sunday, September 13, 2009 3:23 PM
    • Marked as answer by Shariq Ayaz Sunday, September 20, 2009 2:16 AM
    Sunday, September 13, 2009 3:22 PM
  • dj pip..
    i was able to manage to get your code to work.. very nice job on it..
    i just wanted to let you know, i had to modify your code slightly, add some code, but your solution, did, d/l the video and i was able to play the videos back..  yay!

    i am sure, shariq would like to implement a progressbar, to show the progress of the d/l.  i sure did..
    i would not know where to start to even add such.

    to d/l the file, i simply use the System.Net.WebClient and your provided "signature".

    but, where would i add the progressbar code, and what code exactly ?

    i just wish that i was the one, able, to propose your answer, since i was able to test your code and it it worked.


    i live here and this is my reason ... trujade.
    • Marked as answer by Shariq Ayaz Sunday, October 11, 2009 8:05 PM
    • Unmarked as answer by Shariq Ayaz Sunday, October 11, 2009 8:05 PM
    • Marked as answer by Shariq Ayaz Sunday, October 11, 2009 8:05 PM
    • Edited by •.trujade.• Sunday, August 15, 2010 8:05 PM
    Friday, September 18, 2009 9:30 PM
  • Hi ShariqDON and trujade !

    I have made a sample project in Visual Basic here that you can use to help you download You-Tube files with a progress bar.
    The user must enter the You-Tube address like 'http://www.youtube.com/watch?v=hwQdGY6JuDY ' into the textbox of the software and it will attempt to download the video.

    You-Tube videos are stored at You-Tube in .FLV and .MP4 formats.
    There seems to be no reliable way to choose which version you download so it's currently 'pot luck'.
    The example attached below, will check to see if it is a .FLV video or a .MP4 one and then show the user a save file box.
    Then they can choose a place to save it and the download starts.

    At the end of the download, the progress bar will reach 100% and a message will be shown.

    I hope this helps both of you!

    DJ PIP

    SAMPLE PROJECT BELOW ....
    http://www.justpip.com/Limewire/YouTubeDownloader.zip

    P.S: For your safety, I have removed any compiled bits of the program in this attachment. You will need to re-build them in Visual Basic / Studio yourself!
    • Proposed as answer by DJ PIP Saturday, September 19, 2009 12:05 PM
    • Marked as answer by Shariq Ayaz Sunday, September 20, 2009 2:16 AM
    Saturday, September 19, 2009 12:05 PM
  • When I see this, I assume that you have never used debug with breakpoints (be aware that your selection is debug).

    Go to the row in your program which is now yellow and click on left button.

    Select set Breakpoint and do that then run your program.

    It will then exactly stop on that instruction (so before it is done)

    By hoovering with the mouse of the fields then you can see the contents.

    (Don't send next time your complete program, the piece of code in this message plus the error should be enough)


    Success
    Cor
    • Marked as answer by Shariq Ayaz Saturday, September 5, 2009 5:10 PM
    • Unmarked as answer by Shariq Ayaz Saturday, September 5, 2009 5:10 PM
    • Marked as answer by Shariq Ayaz Monday, September 7, 2009 9:11 AM
    • Unmarked as answer by Shariq Ayaz Monday, September 7, 2009 9:13 AM
    • Marked as answer by Shariq Ayaz Tuesday, October 27, 2009 8:04 PM
    Saturday, September 5, 2009 3:24 PM

All replies

  • Hello I am make Youtube downloader But iget some error Please Helpme to Complete this Process
    (Youtube is the Basicaly Online Video Website who Containg FLV file Video)

    If You Get Help Must Vote  here
    • Merged by Martin Xie - MSFT Friday, September 11, 2009 9:09 AM Merge it to keep them in the same topic.
    • Edited by Shariq Ayaz Tuesday, October 27, 2009 8:02 PM
    Saturday, September 5, 2009 1:39 PM
  • Than you should show that piece of code with the error that it gives.


    Success
    Cor
    Saturday, September 5, 2009 2:21 PM
  • Don't try to download the movies directly like :
       my.computer.network.downloadfile("www.youtube.com\....." , "C:\")
    you should have to get the link in an xml file... but how to find that xml file i don't know...

    • Marked as answer by Shariq Ayaz Sunday, October 11, 2009 8:03 PM
    • Unmarked as answer by Shariq Ayaz Wednesday, October 24, 2012 10:55 AM
    Saturday, September 5, 2009 2:38 PM
  • please this is incomplete thread please come here i m remove it after 10 minut


    http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/2c213d8d-87dc-422f-b471-79c0d4fd1c43?prof=required



    please come in "Online Video downloader" uper is link
    Saturday, September 5, 2009 2:51 PM
  • i also give you all things
    Saturday, September 5, 2009 2:52 PM
  • please delet your all reply
    Saturday, September 5, 2009 2:56 PM
  • i get this error




    instruction :
    Play any video on webbrowser and Copy the url link and past it in textbox1 And Press Check Button
    its autometicly show title name of Video in Lable when i press download button its give error ^
    Saturday, September 5, 2009 3:08 PM
  • When I see this, I assume that you have never used debug with breakpoints (be aware that your selection is debug).

    Go to the row in your program which is now yellow and click on left button.

    Select set Breakpoint and do that then run your program.

    It will then exactly stop on that instruction (so before it is done)

    By hoovering with the mouse of the fields then you can see the contents.

    (Don't send next time your complete program, the piece of code in this message plus the error should be enough)


    Success
    Cor
    • Marked as answer by Shariq Ayaz Saturday, September 5, 2009 5:10 PM
    • Unmarked as answer by Shariq Ayaz Saturday, September 5, 2009 5:10 PM
    • Marked as answer by Shariq Ayaz Monday, September 7, 2009 9:11 AM
    • Unmarked as answer by Shariq Ayaz Monday, September 7, 2009 9:13 AM
    • Marked as answer by Shariq Ayaz Tuesday, October 27, 2009 8:04 PM
    Saturday, September 5, 2009 3:24 PM
  • how can i make it complete its get my continio 5 hrs please any one help me Sincerly

    If You Get Help Must Vote here

     



    thanx
    thanx in advance

     

    Saturday, September 5, 2009 6:25 PM
  • The purpose of these forums is to help with particular bugs, not with "some" bugs and to search for those bugs.

    In a forum the showed code is about 20 lines maximum.

    What you can do for that, and is often advised is making a simple program that contains your bugs from about 20 lines and show that in that forum, probably you find than yourself the bugs, but can show that here.





    Success
    Cor
    • Marked as answer by Shariq Ayaz Monday, September 7, 2009 9:11 AM
    • Unmarked as answer by Shariq Ayaz Monday, September 7, 2009 9:13 AM
    Sunday, September 6, 2009 6:08 AM
  • euh,....
    Sunday, September 6, 2009 6:51 AM
  • hello, how are you going with your youtube downloader software?

    there is a software on market to downlaod from youtube its called:

    FlashLynx Video Download Software.


    if you want it just type on Google and u'll find it for free.


    DeepF1
    Sunday, September 6, 2009 4:31 PM
  • I think this is not cheat. we are simply download these video.
    Like "internet download manager"
    any person download my Project ????
    if you download it ... how type of error you get?





    If You Get Help Must Vote For DJ PIP

    • Edited by Shariq Ayaz Tuesday, October 27, 2009 8:06 PM
    Monday, September 7, 2009 9:17 AM
  • Flashget is also free and does this, so does MediaCatcher.

    Flashget has a browser plugin too...
    Monday, September 7, 2009 12:42 PM
  • i get error when i Press download button......












    If You Get Help Must Vote For DJ PIP

    • Edited by Shariq Ayaz Tuesday, October 27, 2009 8:07 PM
    Tuesday, September 8, 2009 6:32 AM
  • Tuesday, September 8, 2009 6:32 AM
  • InvalidArgument=Value of "-1" is not Valid for "Start",

    Tuesday, September 8, 2009 6:34 AM
    • Merged by Martin Xie - MSFT Monday, September 14, 2009 8:37 AM Merge it to keep them in the same topic.
    Tuesday, September 8, 2009 3:03 PM
  • Tuesday, September 8, 2009 3:16 PM
  • I get this Error
    Tuesday, September 8, 2009 3:17 PM
  • SOrry for double post
    because i think this is "Language Question"  I m startting this thread in "Genernal"
    Sorry
    Tuesday, September 8, 2009 3:19 PM
  • Hi My Project is work on in condition if i have instal Internet Explorer 7.

    Friday, September 11, 2009 9:35 AM
  • Don't try to download the movies directly like :
       my.computer.network.downloadfile("www.youtube.com\....." , "C:\")
    you should have to get the link in an xml file... but how to find that xml file i don't know...


    any person Explain meWHat did hi Maximvdw say?????????
    Sunday, September 13, 2009 10:42 AM
  • Hi,

    Look the reason that you are getting the Error is becase You-Tube have changed there download systems.
    Believe Me I Know, I have already made this particular type of software and had to change my download methord recently.

    All I can say to help you is that if you visit ANY Youtube page and rick click and select 'View Source', in the code you will see the following ....

    var MSG_Hide = 'Hide';
    		var MSG_Show = 'Show';
    		var MSG_Login = 'Please sign in to perform this operation.';
    		var MSG_Loading = 'Loading...';
    		var MSG_ShowingAll = 'Showing All Videos';
    		var MSG_LoginFavorites = 'You must be logged in to add this video to your favourites';
    		var MSG_LoginAddPlaylist = 'You must be logged in to add this video to a playlist.';
    		var MSG_LoginReportConcern = 'You must be logged in to report a concern.';
    		var MSG_FlagDefault = 'Select a Reason';
    
    			var swfUrl = canPlayV9Swf() ? "http://s.ytimg.com/yt/swf/watch-vfl119857.swf" : "http://s.ytimg.com/yt/swf/watch_v8-vfl119857.swf";
    
    
    		var swfArgs = {"rv.2.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdRGX2ylid_s%2Fdefault.jpg", "rv.7.length_seconds": "149", "rv.0.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpLk598kDTYk", "rv.0.view_count": "11194", "rv.2.title": "Adebayor+Celebration+Infront+of+Arsenal+Fans", "rv.7.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FVzowC9MHNq0%2Fdefault.jpg", "rv.4.rating": "5.0", "length_seconds": "39", "rv.0.title": "Emmanuel+Adebayor+Celebration+against+Arsenal+Fans", "rv.7.title": "Ronaldinho+Gaucho+vs+Lionel+Messi+WHO+WILL+WIN%3F+-+29%2F06%2F2008", "rv.3.view_count": "12017", "rv.5.title": "Liverpool+4-2+Arsenal+Uefa+Champions+League+Quarter+Final+L2", "rv.0.length_seconds": "62", "rv.4.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FNgUlAFuADZI%2Fdefault.jpg", "fmt_url_map": "34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D34%26ipbits%3D0%26signature%3D8F2F83B37B0A1414079EF0B94911B2A09271B252.5A966660251C329A46FF5122A33AAC343D2C96D8%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7%2C5%7Chttp%3A%2F%2Fv2.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D5%26ipbits%3D0%26signature%3DC47F66E22C5422287181220855CAEE2BE7207EB8.93C452DC09997B1DA12A110250C730231905A0EC%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7", "rv.2.rating": "3.66666666667", "keywords": "Emmanuel%2CAdebayor%2CRuns%2CTo%2CCelebrated%2CHis%2CGoal%2CIn%2CFront%2COf%2CThe%2CArsenal%2CFans%2CMan%2CCity%2C4-1", "cr": "GB", "rv.1.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMyoKcu8bcNQ", "rv.6.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdlQs2FzjxNg%2Fdefault.jpg", "rv.3.length_seconds": "68", "rv.1.id": "MyoKcu8bcNQ", "rv.3.rating": "5.0", "rv.6.title": "Adebayor+FM+2008+Goal", "rv.7.id": "VzowC9MHNq0", "iv_storage_server": "http%3A%2F%2Fwww.google.com%2Freviews%2Fy%2F", "rv.1.title": "Man+City+-+Arsenal+%3A+Adebayor+Goal+%28Run+to+Arsenal+fans%29", "rv.1.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FMyoKcu8bcNQ%2Fdefault.jpg", "creator": "AllFootyVideos0910", "rv.0.rating": "4.62820512821", "feature": "popular", "watermark": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf", "rv.6.author": "Raul4HH", "rv.3.title": "Arsenal+-+10+Best+Goals+2007%2F2008+--+8", "rv.5.id": "TYKXr_o23lQ", "rv.4.author": "footballshirtculture", "rv.1.view_count": "39002", "rv.0.id": "pLk598kDTYk", "iv_module": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fiv_module-vfl119825.swf", "rv.5.rating": "1.81935483871", "rv.4.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNgUlAFuADZI", "sdetail": "f%3Apopular%2Cp%3A%2F", "rv.1.author": "AftonbladetChannel", "rv.1.rating": "4.11578947368", "rv.4.title": "Adidas+F50i+-+Every+Team+Needs+The+Spark", "rv.5.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FTYKXr_o23lQ%2Fdefault.jpg", "rv.5.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTYKXr_o23lQ", "rv.6.length_seconds": "22", "sourceid": "y", "rv.0.author": "Dabadiestkidalive1", "rv.3.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FaB9c8aomPgU%2Fdefault.jpg", "rv.2.author": "Gippa123", "rv.6.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdlQs2FzjxNg", "rv.7.rating": "4.37671232877", "rv.3.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaB9c8aomPgU", "fmt_map": "34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0", "hl": "en", "rv.7.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVzowC9MHNq0", "rv.2.view_count": "431", "rv.4.length_seconds": "91", "rv.4.view_count": "1309", "rv.2.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdRGX2ylid_s", "plid": "AARzddnKWUyWEV_s", "rv.5.length_seconds": "222", "rv.0.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FpLk598kDTYk%2Fdefault.jpg", "rv.7.author": "deathblade125", "sk": "NjRpdm6YlrdvlXwhHjKNZrRguk-fkCwMC", "rv.5.view_count": "91421", "sw": "0.05", "rv.1.length_seconds": "39", "rv.6.rating": "1.0", "rv.5.author": "sarahck3984", "vq": "medium", "rv.3.id": "aB9c8aomPgU", "rv.2.id": "dRGX2ylid_s", "rv.2.length_seconds": "14", "t": "vjVQa1PpcFPi0WzmPLoi8nNn5wgjOnXPSvmkY-j5nrA%3D", "rv.6.id": "dlQs2FzjxNg", "video_id": "Vjlww0gMEOc", "rv.6.view_count": "475", "rv.3.author": "BeliarTheCursed", "rv.4.id": "NgUlAFuADZI", "rv.7.view_count": "234574"};
    		var watchGamUrl = null;
    		var watchDCUrl = null;
    		var expressInstallUrl = null;

    You need to EXTRACT the following line:

    var swfArgs = {"rv.2.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdRGX2ylid_s%2Fdefault.jpg", "rv.7.length_seconds": "149", "rv.0.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DpLk598kDTYk", "rv.0.view_count": "11194", "rv.2.title": "Adebayor+Celebration+Infront+of+Arsenal+Fans", "rv.7.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FVzowC9MHNq0%2Fdefault.jpg", "rv.4.rating": "5.0", "length_seconds": "39", "rv.0.title": "Emmanuel+Adebayor+Celebration+against+Arsenal+Fans", "rv.7.title": "Ronaldinho+Gaucho+vs+Lionel+Messi+WHO+WILL+WIN%3F+-+29%2F06%2F2008", "rv.3.view_count": "12017", "rv.5.title": "Liverpool+4-2+Arsenal+Uefa+Champions+League+Quarter+Final+L2", "rv.0.length_seconds": "62", "rv.4.thumbnailUrl": "http%3A%2F%2Fi3.ytimg.com%2Fvi%2FNgUlAFuADZI%2Fdefault.jpg", "fmt_url_map": "34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D34%26ipbits%3D0%26signature%3D8F2F83B37B0A1414079EF0B94911B2A09271B252.5A966660251C329A46FF5122A33AAC343D2C96D8%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7%2C5%7Chttp%3A%2F%2Fv2.lscache3.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D5%26ipbits%3D0%26signature%3DC47F66E22C5422287181220855CAEE2BE7207EB8.93C452DC09997B1DA12A110250C730231905A0EC%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7", "rv.2.rating": "3.66666666667", "keywords": "Emmanuel%2CAdebayor%2CRuns%2CTo%2CCelebrated%2CHis%2CGoal%2CIn%2CFront%2COf%2CThe%2CArsenal%2CFans%2CMan%2CCity%2C4-1", "cr": "GB", "rv.1.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMyoKcu8bcNQ", "rv.6.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FdlQs2FzjxNg%2Fdefault.jpg", "rv.3.length_seconds": "68", "rv.1.id": "MyoKcu8bcNQ", "rv.3.rating": "5.0", "rv.6.title": "Adebayor+FM+2008+Goal", "rv.7.id": "VzowC9MHNq0", "iv_storage_server": "http%3A%2F%2Fwww.google.com%2Freviews%2Fy%2F", "rv.1.title": "Man+City+-+Arsenal+%3A+Adebayor+Goal+%28Run+to+Arsenal+fans%29", "rv.1.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FMyoKcu8bcNQ%2Fdefault.jpg", "creator": "AllFootyVideos0910", "rv.0.rating": "4.62820512821", "feature": "popular", "watermark": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Flogo-vfl106645.swf%2Chttp%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fhdlogo-vfl100714.swf", "rv.6.author": "Raul4HH", "rv.3.title": "Arsenal+-+10+Best+Goals+2007%2F2008+--+8", "rv.5.id": "TYKXr_o23lQ", "rv.4.author": "footballshirtculture", "rv.1.view_count": "39002", "rv.0.id": "pLk598kDTYk", "iv_module": "http%3A%2F%2Fs.ytimg.com%2Fyt%2Fswf%2Fiv_module-vfl119825.swf", "rv.5.rating": "1.81935483871", "rv.4.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DNgUlAFuADZI", "sdetail": "f%3Apopular%2Cp%3A%2F", "rv.1.author": "AftonbladetChannel", "rv.1.rating": "4.11578947368", "rv.4.title": "Adidas+F50i+-+Every+Team+Needs+The+Spark", "rv.5.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FTYKXr_o23lQ%2Fdefault.jpg", "rv.5.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DTYKXr_o23lQ", "rv.6.length_seconds": "22", "sourceid": "y", "rv.0.author": "Dabadiestkidalive1", "rv.3.thumbnailUrl": "http%3A%2F%2Fi2.ytimg.com%2Fvi%2FaB9c8aomPgU%2Fdefault.jpg", "rv.2.author": "Gippa123", "rv.6.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdlQs2FzjxNg", "rv.7.rating": "4.37671232877", "rv.3.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaB9c8aomPgU", "fmt_map": "34%2F0%2F9%2F0%2F115%2C5%2F0%2F7%2F0%2F0", "hl": "en", "rv.7.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DVzowC9MHNq0", "rv.2.view_count": "431", "rv.4.length_seconds": "91", "rv.4.view_count": "1309", "rv.2.url": "http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdRGX2ylid_s", "plid": "AARzddnKWUyWEV_s", "rv.5.length_seconds": "222", "rv.0.thumbnailUrl": "http%3A%2F%2Fi1.ytimg.com%2Fvi%2FpLk598kDTYk%2Fdefault.jpg", "rv.7.author": "deathblade125", "sk": "NjRpdm6YlrdvlXwhHjKNZrRguk-fkCwMC", "rv.5.view_count": "91421", "sw": "0.05", "rv.1.length_seconds": "39", "rv.6.rating": "1.0", "rv.5.author": "sarahck3984", "vq": "medium", "rv.3.id": "aB9c8aomPgU", "rv.2.id": "dRGX2ylid_s", "rv.2.length_seconds": "14", "t": "vjVQa1PpcFPi0WzmPLoi8nNn5wgjOnXPSvmkY-j5nrA%3D", "rv.6.id": "dlQs2FzjxNg", "video_id": "Vjlww0gMEOc", "rv.6.view_count": "475", "rv.3.author": "BeliarTheCursed", "rv.4.id": "NgUlAFuADZI", "rv.7.view_count": "234574"};
    
    And get your software to download the URL located within ...

    Eg.

    34%7Chttp%3A%2F%2Fv2.lscache8.c.youtube.com%2Fvideoplayback%3Fip%3D0.0.0.0%26sparams%3Did%252Cexpire%252Cip%252Cipbits%252Citag%252Cburst%252Cfactor%26itag%3D34%26ipbits%3D0%26signature%3D8F2F83B37B0A1414079EF0B94911B2A09271B252.5A966660251C329A46FF5122A33AAC343D2C96D8%26sver%3D3%26expire%3D1252872000%26key%3Dyt1%26factor%3D1.25%26burst%3D40%26id%3D563970c3480c10e7%2C5%7C

    Please note that the enclosed URL shown above odviously won't work because characters like '%2F' actually stand for '/'.
    You would need to write some code to change these to the correct letter values.

    Hope this helps,
    DJ PIP
    • Proposed as answer by DJ PIP Sunday, September 13, 2009 1:57 PM
    • Marked as answer by Shariq Ayaz Sunday, September 20, 2009 2:16 AM
    Sunday, September 13, 2009 1:57 PM
  • Hi DJ!

     

    how do i extract that certain line?

    Sunday, September 13, 2009 2:06 PM
  • Imports System.Net
    Imports System.IO
    
    Public Class Form1
    
        Public request As HttpWebRequest
        Public response As HttpWebResponse
        Public source As String
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            request = DirectCast(HttpWebRequest.Create("http://www.youtube.com/watch?v=hwQdGY6JuDY"), HttpWebRequest)
            response = DirectCast(request.GetResponse, HttpWebResponse)
            source = New StreamReader(response.GetResponseStream, System.Text.Encoding.Default).ReadToEnd
    
            If source.IndexOf("video_id") > -1 Then
                'This grabs the .flv location URL ready for doownloading.
                Dim signature As String = source
                signature = System.Text.RegularExpressions.Regex.Split(signature, (ChrW(34) + "fmt_url_map" + ChrW(34) + ": " + ChrW(34)))(1)
                'This changes the URL to conform to internet standards eg. %20 = " "
                signature = signature.Remove(0, 5)
                signature = signature.Replace("%252C", ",")
                signature = signature.Replace("%2F", "/")
                signature = signature.Replace("%3D", "=")
                signature = signature.Replace("%3F", "?")
                signature = signature.Replace("%3A", ":")
                signature = signature.Replace("%26", "&")
                Dim sig2 As String = signature
                sig2 = sig2.IndexOf("http", 30)
                signature = signature.Remove(sig2, signature.Length - sig2)
                signature = signature.Remove(signature.IndexOf("%"), 7)
                'Removes any remaining % characters from the string.
                signature = signature.Replace("%", "")
                'Checks for and Removes any remaining C characters from the string.
                If signature.Chars(signature.Length - 1) = "C" Then
                    signature = signature.Remove(signature.Length - 1, 1)
                End If
                MsgBox("Here is the address to download the You-Tube Video:" + vbCrLf + signature.ToString())
            Else
                Msgbox("Error! Invalid URL?")
            End If
        End Sub
    
    End Class
    Create a new form and add 1 button.
    Odviously you need to implement the actual download of the video and the ability to select the video URL.
    Just change the video in the code for now.
    Hope this helps.

    DJ PIP
    • Proposed as answer by DJ PIP Sunday, September 13, 2009 3:23 PM
    • Marked as answer by Shariq Ayaz Sunday, September 20, 2009 2:16 AM
    Sunday, September 13, 2009 3:22 PM
  • Hi ShariqDON ,

    How is it going? Could you get my sample above to work?

    DJ PIP
    Friday, September 18, 2009 3:02 PM
  • dj pip..
    i was able to manage to get your code to work.. very nice job on it..
    i just wanted to let you know, i had to modify your code slightly, add some code, but your solution, did, d/l the video and i was able to play the videos back..  yay!

    i am sure, shariq would like to implement a progressbar, to show the progress of the d/l.  i sure did..
    i would not know where to start to even add such.

    to d/l the file, i simply use the System.Net.WebClient and your provided "signature".

    but, where would i add the progressbar code, and what code exactly ?

    i just wish that i was the one, able, to propose your answer, since i was able to test your code and it it worked.


    i live here and this is my reason ... trujade.
    • Marked as answer by Shariq Ayaz Sunday, October 11, 2009 8:05 PM
    • Unmarked as answer by Shariq Ayaz Sunday, October 11, 2009 8:05 PM
    • Marked as answer by Shariq Ayaz Sunday, October 11, 2009 8:05 PM
    • Edited by •.trujade.• Sunday, August 15, 2010 8:05 PM
    Friday, September 18, 2009 9:30 PM
  • Hi Sir DJ sorry I cant get help to your last reply
    Saturday, September 19, 2009 11:33 AM
  • Hi ShariqDON and trujade !

    I have made a sample project in Visual Basic here that you can use to help you download You-Tube files with a progress bar.
    The user must enter the You-Tube address like 'http://www.youtube.com/watch?v=hwQdGY6JuDY ' into the textbox of the software and it will attempt to download the video.

    You-Tube videos are stored at You-Tube in .FLV and .MP4 formats.
    There seems to be no reliable way to choose which version you download so it's currently 'pot luck'.
    The example attached below, will check to see if it is a .FLV video or a .MP4 one and then show the user a save file box.
    Then they can choose a place to save it and the download starts.

    At the end of the download, the progress bar will reach 100% and a message will be shown.

    I hope this helps both of you!

    DJ PIP

    SAMPLE PROJECT BELOW ....
    http://www.justpip.com/Limewire/YouTubeDownloader.zip

    P.S: For your safety, I have removed any compiled bits of the program in this attachment. You will need to re-build them in Visual Basic / Studio yourself!
    • Proposed as answer by DJ PIP Saturday, September 19, 2009 12:05 PM
    • Marked as answer by Shariq Ayaz Sunday, September 20, 2009 2:16 AM
    Saturday, September 19, 2009 12:05 PM
  • Cheking...........

    Sunday, September 20, 2009 1:42 AM
  • DJ PIP
    Great Job
    Nice
    Its Work Fine
    Thanx Alot

    • Edited by Shariq Ayaz Sunday, September 20, 2009 2:29 AM
    Sunday, September 20, 2009 2:16 AM
  • WELDONE AND THANX AGAIN
    CAN I PICK TITLE NAME OF VIDEO IN SAVE FILE DIALOG



    WELDONE AND THANX AGAIN
    Sunday, September 20, 2009 2:20 AM
  • And Thanx to all Buddies to Participate
    Sunday, September 20, 2009 2:26 AM
  • Don't try to download the movies directly like :
       my.computer.network.downloadfile("www.youtube.com\....." , "C:\")
    you should have to get the link in an xml file... but how to find that xml file i don't know...


    any person Explain meWHat did hi Maximvdw say?????????

    Hey that was before you posted the error....
    • Marked as answer by Shariq Ayaz Sunday, October 18, 2009 10:05 AM
    • Unmarked as answer by Shariq Ayaz Wednesday, October 24, 2012 10:55 AM
    Sunday, September 20, 2009 8:02 AM
  • if u need to convert flv files to avi in vb.net go to: http://www.developerfusion.com/forum/thread/56677/

    • Marked as answer by Shariq Ayaz Sunday, September 20, 2009 4:02 PM
    • Unmarked as answer by Shariq Ayaz Wednesday, October 24, 2012 10:55 AM
    Sunday, September 20, 2009 8:06 AM
  • i Get this error

    Error 2 'StepInMS' is not declared. It may be inaccessible due to its protection level. C:\Users\Steven\AppData\Local\Temporary Projects\Youtube Video Downloader\Form1.vb 83 44 Youtube Video Downloader

    and this error

    Error 1 'TotalDelayInMS' is not declared. It may be inaccessible due to its protection level. C:\Users\Steven\AppData\Local\Temporary Projects\Youtube Video Downloader\Form1.vb 83 27 Youtube Video Downloader

    please help me

    Sunday, March 25, 2012 3:41 PM