public static GetDownloadUrls ( string videoUrl, bool decryptSignature = true ) : IEnumerable |
||
videoUrl | string | The URL of the YouTube video. |
decryptSignature | bool |
/// A value indicating whether the video signatures should be decrypted or not. Decrypting
/// consists of a HTTP request for each |
리턴 | IEnumerable |
static void Main(string[] args) { try { //var link = new List<string>(); //link.Add("https://www.youtube.com/watch?v=GlGuLcQhrWg"); string link = @"https://www.youtube.com/watch?v=YzC-FYg66xA&list=PL0kIvpOlieSNWR3YPSjh9P2p43SFnNBlB&index=1"; //foreach (var item in link) //{ IEnumerable <VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls("https://www.youtube.com/watch?v=YzC-FYg66xA&list=PL0kIvpOlieSNWR3YPSjh9P2p43SFnNBlB&index=1"); VideoInfo video = videoInfos.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 720); var videoDownloader = new VideoDownloader(video, Path.Combine(@"C:\Users\lalomarquez\Desktop\", video.Title + video.VideoExtension)); videoDownloader.DownloadProgressChanged += (sender, argss) => Console.WriteLine(argss.ProgressPercentage); videoDownloader.Execute(); //} } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public static Task <IEnumerable <VideoInfo> > GetDownloadUrlsAsync(string videoUrl, bool decryptSignature = true) { return(Task.Run <IEnumerable <VideoInfo> >(() => DownloadUrlResolver.GetDownloadUrls(videoUrl, decryptSignature))); }