コード例 #1
0
        private void VideoIndir(IEnumerable <VideoInfo> videoBilgileri)
        {
            VideoInfo video = videoBilgileri
                              .First(bilgi => bilgi.VideoType == VideoType.Mp4 && bilgi.Resolution == 360);

            if (video.RequiresDecryption)
            {
                DownloadUrlResolver.DecryptDownloadUrl(video);
            }

            string ism = video.Title;

            ism = Helper.makeFilenameValid(ism).Replace("/", "")
                  .Replace(".", "")
                  .Replace("|", "")
                  .Replace("?", "")
                  .Replace("<", "")
                  .Replace(">", "")
                  .Replace("\\", "")
                  .Replace("*", "")
                  .Replace("!", "");

            VideoDownloader dl = new VideoDownloader();

            dl.DownloadFile(video.DownloadUrl, ism, true, Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), video.VideoExtension);

            dosya = ism + video.VideoExtension;
            boyut = video.FileSize;
            timer1.Start();
        }
コード例 #2
0
        private static void DownloadVideo(IEnumerable <VideoInfo> videoInfos)
        {
            // Select the first .mp4 video with 360p resolution
            VideoInfo video = videoInfos
                              .First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360);

            // Decrypt only if needed
            if (video.RequiresDecryption)
            {
                DownloadUrlResolver.DecryptDownloadUrl(video);
            }

            // Create the video downloader.
            VideoDownloader dl = new VideoDownloader();

            dl.DownloadFile(video.DownloadUrl, video.Title, true, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), video.VideoExtension);
        }