示例#1
0
        public void TestDownload()
        {
            _ytHandler.ClearQueue();
            _ytHandler.Queue(_ytAddress);
            _ytHandler.DownloadQueue().Wait();

            var downloads = _ytHandler.GetDownloadedFromQueue();
            var videoId   = _ytHandler.ParseVideoId(_ytAddress);
            var model     = _ytHandler.GetModelByVideoId(videoId);

            Assert.True(model.FileExists);
        }
示例#2
0
        private IVideoModel DownloadVideoIfNotExists()
        {
            var expectedFilePath = _config.DownloadDirectory + "C0DPdy98e4c.mp4";
            var fileExists       = File.Exists(expectedFilePath);

            if (!fileExists)
            {
                _ytHandler.ClearQueue();
                _ytHandler.Queue(_url);
                _ytHandler.DownloadQueue().Wait();
            }

            return(_trimmer.Load(expectedFilePath));
        }