誰もが精通していlibvideo
ますか?私は[libvideo][1]
アプリケーションを持っています。
プロキシ設定をに挿入するにはどうすればよいlibvideo
ですか?
using VideoLibrary;
void SaveVideoToDisk(string link)
{
var youTube = YouTube.Default; // starting point for YouTube actions
var video = youTube.GetVideo(link); // gets a Video object with info about the video
File.WriteAllBytes(@"C:\" + video.FullName, video.GetBytes());
}
libvideo
プロキシをサポートしていないようです。したがってyoutube-dl
、上記のコードを使用して修正する必要があります
public static void YouTubeDownloaderWithProxy(string link, string path)
{
Process youTube = new Process();
try
{
string code = link.Split('/').LastOrDefault();
string proxy = @"http://....:8585/";
string youtubeUrl = @"https://www.youtube.com/watch?v=" + "code";
youTube.StartInfo.UseShellExecute = true;
youTube.StartInfo.CreateNoWindow = false;
youTube.StartInfo.FileName = Application.StartupPath + @"\youtube-dl.exe";
youTube.StartInfo.Arguments = $"--proxy {proxy} -o '{path}' {youtubeUrl}";
youTube.Start();
youTube.WaitForExit();
youTube.Dispose();
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}
}
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加