Results 1 to 24 of 24

Thread: Downloading Youtube clips

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2008
    Posts
    22

    Question Downloading Youtube clips

    Hi everyone

    I'm trying to create a program on which i can download youtube clips bye pasting their links into a textbox and pressing a button but don't know how to do it. I searched in google but i couldn't find the right solution. I hope someone can help me.

    Thanks in advanced!!!!!

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Downloading Youtube clips

    Have you seen if they have any info on that on http://www.youtube.com/dev?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Downloading Youtube clips

    What language are you using?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Feb 2008
    Posts
    22

    Re: Downloading Youtube clips

    Hi

    I'm using Visual basic (vb.net 2005 IDE).

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Downloading Youtube clips

    How about something like (untested)
    Code:
    My.Computer.Network.DownLoadFile(Textbox1.Text, "c:\vadi", "username", password")

  6. #6
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Downloading Youtube clips

    The hard part might be trying to get the URL to the actual media file/flash video embedded in the page.

    I could be mistaken, but I think they use JavaScript or something else to encode the URL to the .swf video file.

  7. #7
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Downloading Youtube clips

    Its a dynamically determined path on a different server for downloading the flv file
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  8. #8
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Downloading Youtube clips

    is there a way to determine the actual link? Perhaps calling the javascript?
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Downloading Youtube clips

    Well there is a javascript variable that contains the path.

    var swfUrl = '/player2.swf';
    var swfArgs = {"e": "h", "sourceid": "y", "video_id": "6MFMEUtmF-A", "l": 44, "sk": "JKO_asxtlW_xe3eIs0UZ9AU", "t": "OEgsToPDskIZ6fUnnYIqLcvRuEZxQKSz", "hl": "en", "plid": "AARFlSgZ9IjBOJviAAAAoAAYAAA", "sdetail": "p%3A/browse"};
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Downloading Youtube clips

    I have The Method to Access to Those Clip flv without any programme
    so if interested i can post how to get it & then we can you cree the algo for it & running in vb.Net 2005 & post it in the CodeBank !

  11. #11
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Downloading Youtube clips

    Sure sounds good.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  12. #12
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Downloading Youtube clips

    oK let's Take an Example !
    1/This is the Link original from Youtube

    http://www.youtube.com/watch?v=Ulf5CdFykX0

    2/we will change This Url Like This way

    http://www.youtube.com/watch/v/Ulf5CdFykX0

    we removed the ? & = and replaced with /
    when you type this 2 url you will Get The Url of the page like this
    3/In The Browser Get The Url After &t= like

    http://www.youtube.com/swf/l.swf?vid...n7pyvjYR30g849

    Now This is The mean what we need , if we look well in the url what we need is this

    &t=OEgsToPDskIpUGfLc8AzYa2_L5Zq_MSI

    The one started from &t

    4/Now enter The Full URL Like this & download Your file

    http://youtube.com/get_video.php?vid...AzYa2_L5Zq_MSI

    if we see very well
    Ulf5CdFykX0 = The id of the url
    &t=OEgsToPDskIpUGfLc8AzYa2_L5Zq_MSI = The link to download it

    so Now we need to work on a algo that will do those operations

    Thanks !

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Downloading Youtube clips

    Oh yes I remember that method. Its from this post by Chris001
    http://www.vbforums.com/showpost.php...78&postcount=2

    But it seems there are some issues with it as noted in the thread.

    My solution works fine if you want to download the video right away, but you can't post the final link on an other webpage, because the link expires.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Downloading Youtube clips

    sorry I havent seen This Thread before , because this way i got it from my sister

  15. #15
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Downloading Youtube clips

    Well as long as the issue gets solved

    We cant be sure but it may appear that its for immediate download but if not then the links will be broken.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  16. #16

    Thread Starter
    Junior Member
    Join Date
    Feb 2008
    Posts
    22

    Re: Downloading Youtube clips

    First of all thanks for your replies!!!!!!

    Guys i tried this things but it only downloads only a small file like 100kb or so.
    So it doesnt work. I would eppriciate if someone could give me a sample of that cos i don't think that i can do it otherwise.

    Thanks in advanced!!!

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Downloading Youtube clips

    I followed the directions ffrom the link I posted and it downloaded a 7.9 MB file.

    This is my end result url I constructed but remember that it will only be available for a short time.

    http://www.youtube.com/get_video.php...GWOFRYyCQ4KOqd
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Downloading Youtube clips

    they worked for me too, IN A BROWSER. If you try to copy the link into a download accelerator, it fails. Incidently, if you get a 100kb file, rename it with a .htm extension and look again...
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  19. #19

    Thread Starter
    Junior Member
    Join Date
    Feb 2008
    Posts
    22

    Thumbs up Re: Downloading Youtube clips

    Guys thanks for your efforts but this is not what i was looking for. I expected code or a sample program. I will google a bit and see what i can find.

    Thank

  20. #20
    Fanatic Member
    Join Date
    Jul 2007
    Posts
    530

    Re: Downloading Youtube clips

    Quote Originally Posted by vadi
    Guys thanks for your efforts but this is not what i was looking for. I expected code or a sample program. I will google a bit and see what i can find.

    Thank
    Because it's Not a Direct Link !

  21. #21
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142

    Re: Downloading Youtube clips

    i put this together, it's best to run it in another thread ( Backgroundworker ) otherwise the app will sit there locked out until the download has done.
    i tested it on a few vids.
    Code:
            '/// ENTER THE URL THAT YOU WOULD WATCH THE VID ON IN BROWSER ...
            Dim request As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://www.youtube.com/watch?v=FJaAe7sYoCA"), HttpWebRequest)
            Dim response As HttpWebResponse = DirectCast(request.GetResponse, HttpWebResponse)
    
            Dim source As String = New StreamReader(response.GetResponseStream, System.Text.Encoding.Default).ReadToEnd
    
            If source.IndexOf("video_id=") > -1 Then
                Dim url As String = System.Text.RegularExpressions.Regex.Split(source, "video_id=")(1)
                url = "http://www.youtube.com/get_video?video_id=" & System.Text.RegularExpressions.Regex.Split(url, "&title=")(0)
    
                Dim wc As New WebClient
                wc.DownloadFile(url, "C:\FJaAe7sYoCA.flv")
            End If
    
            response.Close()
    might start you off.
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  22. #22
    Frenzied Member
    Join Date
    Nov 2005
    Posts
    1,834

    Re: Downloading Youtube clips

    Here's a VB6 version. Internet Explorer must be installed, because it uses DoFileDownload to download the video.
    Attached Files Attached Files

  23. #23
    New Member
    Join Date
    Nov 2007
    Posts
    8

    Re: Downloading Youtube clips

    Quote Originally Posted by killer7k
    oK let's Take an Example !
    1/This is the Link original from Youtube

    http://www.youtube.com/watch?v=Ulf5CdFykX0

    2/we will change This Url Like This way

    http://www.youtube.com/watch/v/Ulf5CdFykX0

    we removed the ? & = and replaced with /
    when you type this 2 url you will Get The Url of the page like this
    3/In The Browser Get The Url After &t= like

    http://www.youtube.com/swf/l.swf?vid...n7pyvjYR30g849

    Now This is The mean what we need , if we look well in the url what we need is this

    &t=OEgsToPDskIpUGfLc8AzYa2_L5Zq_MSI

    The one started from &t

    4/Now enter The Full URL Like this & download Your file

    http://youtube.com/get_video.php?vid...AzYa2_L5Zq_MSI

    if we see very well
    Ulf5CdFykX0 = The id of the url
    &t=OEgsToPDskIpUGfLc8AzYa2_L5Zq_MSI = The link to download it

    so Now we need to work on a algo that will do those operations

    Thanks !

    thank you!!! for share this code

  24. #24
    Member
    Join Date
    Feb 2008
    Posts
    50

    Re: Downloading Youtube clips

    Quote Originally Posted by dynamic_sysop
    i put this together, it's best to run it in another thread ( Backgroundworker ) otherwise the app will sit there locked out until the download has done.
    i tested it on a few vids.
    Code:
            '/// ENTER THE URL THAT YOU WOULD WATCH THE VID ON IN BROWSER ...
            Dim request As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://www.youtube.com/watch?v=FJaAe7sYoCA"), HttpWebRequest)
            Dim response As HttpWebResponse = DirectCast(request.GetResponse, HttpWebResponse)
    
            Dim source As String = New StreamReader(response.GetResponseStream, System.Text.Encoding.Default).ReadToEnd
    
            If source.IndexOf("video_id=") > -1 Then
                Dim url As String = System.Text.RegularExpressions.Regex.Split(source, "video_id=")(1)
                url = "http://www.youtube.com/get_video?video_id=" & System.Text.RegularExpressions.Regex.Split(url, "&title=")(0)
    
                Dim wc As New WebClient
                wc.DownloadFile(url, "C:\FJaAe7sYoCA.flv")
            End If
    
            response.Close()
    might start you off.

    thanks man it works great

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width