如何使用 VB.net 下载 YouTube 视频

How to download a YouTube video using VB.net

我正在尝试使用 VB.net 和一些名为 LibVideo , LibVideoNuget well it did work for few days but since Youtube announced that it will start using some Video encryption methods to ensure security whenever i paste a Youtube video link and hit Download button it gives me: “GetDecryptionFunction Failed” , this Library works in 10% of youtube video , it works in this video 1 的 API 制作 Youtube 视频下载器软件,我找到了一个用于 .NET 程序的官方 youtube API但它似乎并没有给你播放或下载 Youtube 视频的权限,它只提供一些功能,如上传视频、管理播放列表和订阅、更新频道设置......,如果有帮助的话,这是我的代码:

        Dim Video = YouTube.Default.GetVideo(youtubeURL.Text)
        Me.SaveFileDialog1.FileName = Video.FullName
        If Me.SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

            Me.whereToSave = Me.SaveFileDialog1.FileName

            Me.SaveFileDialog1.FileName = ""

            Me.Label6.Text = "Save to: " & Me.whereToSave

            Me.youtubeURL.Enabled = False
            Me.getThumbailButton.Enabled = False
            Me.btnCancel.Enabled = True

            Me.BackgroundWorker1.RunWorkerAsync() 'Start download
            progressupdatertimer.Start()
            largeImage.Image = My.Resources.loading
            resoltuion.Text = "Resolution: " & Video.Resolution
            bitrate.Text = "Bitrate: " & Video.AudioBitrate
            Dim filesizekb As Long = Math.Round((filesize / 1024), 2)
            Dim filesizemb As Long = Math.Round((filesizekb / 1024), 2)
            filesizemb2 = filesizemb
            Label11.Text = filesizemb2 & " MB"
        End If

GetDecryptionFunction 失败

Google 不希望您从 YouTube 下载视频。视频由视频所有者上传给他们,您下载它们将拿走您不拥有的东西。话虽这么说,多年来人们对图像做同样的事情,这是可能的。

来自 YouTube Terms of Service 第 5.1L 节:

you agree not to access Content or any reason other than your personal, non-commercial use solely as intended through and permitted by the normal functionality of the Service, and solely for Streaming. "Streaming" means a contemporaneous digital transmission of the material by YouTube via the Internet to a user operated Internet enabled device in such a manner that the data is intended for real-time viewing and not intended to be downloaded (either permanently or temporarily), copied, stored, or redistributed by the user;

YouTube api 主要是一个文件系统 api。它允许您将视频上传到您自己的帐户,但它无法下载您自己拥有的视频。

如果您确实设法找到了一个可以下载视频的库,那么它不会得到 Google 的正式支持,您甚至可能会尝试下载视频,从而违反他们的一项服务条款.

LibVideo 的所有者进行了锻炼,现在可以使用了,您可以将其用于个人用途。