Results 1 to 2 of 2
  1. #1
    Forgot Password's Avatar
    Join Date
    Dec 2014
    Gender
    male
    Location
    Hentai Land
    Posts
    21
    Reputation
    10
    Thanks
    4

    YouTube Video Downloader vB or C#

    Hey guys i am currently working on a multi tool and i want to implement a YouTube video downloader tool in it. However i have been looking online on how i can code this. I have tried various methods of my own which really didnt work out so well as they did nothing.

    Any help would be highly appreciated Thanks in advance.

  2. #2
    einaras's Avatar
    Join Date
    Apr 2013
    Gender
    male
    Posts
    642
    Reputation
    22
    Thanks
    1,387
    My Mood
    Fine
    @Forgot Password Ok what you need to do is to download YoutubeExtractor from nuget.

    I used following code in one of my projects to get youtube downloader working:

    vb
    Code:
     Dim videoInfos As IEnumerable(Of VideoInfo) = DownloadUrlResolver.GetDownloadUrls("url of video")
            Dim video As VideoInfo = videoInfos.Where(Function(info) info.CanExtractAudio).OrderByDescending(Function(info) info.AudioBitrate).First()
            If video.RequiresDecryption Then
                DownloadUrlResolver.DecryptDownloadUrl(video)
            End If
            Dim audioDownloader = New AudioDownloader(video, "1.mp3")
            Try
                audioDownloader.Execute()
            Catch ex As Exception            
                MsgBox("Can't download this video, try other one", 0, "")
                Return
            End Try
    nameofvideo = video.Title
    converted to c#

    Code:
    IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls("url of video");
    VideoInfo video = videoInfos.Where(info => info.CanExtractAudio).OrderByDescending(info => info.AudioBitrate).First();
    if (video.RequiresDecryption) {
    	DownloadUrlResolver.DecryptDownloadUrl(video);
    }
    dynamic audioDownloader = new AudioDownloader(video, "1.mp3");
    try {
    	audioDownloader.Execute();
    } catch (Exception ex) {
    	Interaction.MsgBox("Can't download this video, try other one", 0, "");
    	return;
    }
    nameofvideo = video.Title;
    Last edited by einaras; 06-15-2016 at 12:33 PM.

  3. The Following User Says Thank You to einaras For This Useful Post:

    Forgot Password (07-17-2016)

Similar Threads

  1. [Release] YouTube GO Video Downloader [2.0.2.2]
    By Womanizer` in forum Visual Basic Programming
    Replies: 0
    Last Post: 02-20-2013, 06:40 AM
  2. [Release]Youtube Video Downloader
    By Hassan in forum Visual Basic Programming
    Replies: 25
    Last Post: 02-20-2011, 05:35 PM
  3. [Tutorial]How to make a Youtube Video Downloader
    By o0OpurezO0o in forum Programming Tutorials
    Replies: 9
    Last Post: 11-06-2010, 09:03 PM
  4. youtube video downloader????
    By tremaster in forum Visual Basic Programming
    Replies: 6
    Last Post: 11-01-2010, 06:28 AM
  5. [Release]Youtube Video Downloader
    By ShadowPwnz in forum Visual Basic Programming
    Replies: 3
    Last Post: 05-17-2010, 07:23 AM