示例#1
0
        public static List <YouTubeVideoQuality> GetYouTubeVideoUrls(string html)
        {
            List <YouTubeVideoQuality> youTubeVideoQualities = new List <YouTubeVideoQuality>();
            string title = YouTubeDownloader.GetTitle(html);

            foreach (string str in YouTubeDownloader.ExtractUrls(html))
            {
                YouTubeVideoQuality youTubeVideoQuality = new YouTubeVideoQuality()
                {
                    VideoTitle  = title,
                    DownloadUrl = string.Concat(str, "&title=", title)
                };
                if (!YouTubeDownloader.getQuality(youTubeVideoQuality, YouTubeDownloader.IsWideScreen(html)))
                {
                    continue;
                }
                youTubeVideoQualities.Add(youTubeVideoQuality);
            }
            return(youTubeVideoQualities);
        }