YoutubeExtractor icon indicating copy to clipboard operation
YoutubeExtractor copied to clipboard

Only Downloads Some Videos.

Open Koolkuts1 opened this issue 7 years ago • 2 comments

Console.Write("Play Command Executed!\n"); IEnumerable<VideoInfo> videoInfos = DownloadUrlResolver.GetDownloadUrls(file); Console.Write("Video Found!\n"); VideoInfo video = videoInfos .First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360); Console.Write("Download Starting Soon!\n"); if (video.RequiresDecryption) { DownloadUrlResolver.DecryptDownloadUrl(video); } Console.Write("Decryption Finished!\n"); var videoDownloader = new VideoDownloader(video, Path.Combine("D:/download", "CurrentSong" + video.VideoExtension)); videoDownloader.DownloadProgressChanged += (sender, args) => Console.WriteLine(args.ProgressPercentage); videoDownloader.Execute(); When this code is ran and the file variable is given a url it wont go past the part that writes to the console about decryption being done on all but one video that it will download and run without problems normally I am using it with CSharpPlus in an attempt to create a discord bot.

Koolkuts1 avatar Mar 02 '18 23:03 Koolkuts1

please format your text a bit to make it more readable & a bit more beautiful and perhaps could trigger some interest in someone to help you fix that.. huhuu

Console.Write("Play Command Executed!\n");
IEnumerable videoInfos = DownloadUrlResolver.GetDownloadUrls(file);
Console.Write("Video Found!\n");

VideoInfo video = videoInfos
.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360);

Console.Write("Download Starting Soon!\n");
if (video.RequiresDecryption)
             DownloadUrlResolver.DecryptDownloadUrl(video);

Console.Write("Decryption Finished!\n");
var videoDownloader = new VideoDownloader(video, Path.Combine("D:/download", "CurrentSong" + video.VideoExtension));

videoDownloader.DownloadProgressChanged += (sender, args) => Console.WriteLine(args.ProgressPercentage);
videoDownloader.Execute();

When this code is ran and the file variable is given a url it wont go past the part that writes to the console about decryption being done on all but one video that it will download and run without problems normally I am using it with CSharpPlus in an attempt to create a discord bot.

Hanzalah-Adalan avatar Mar 11 '18 15:03 Hanzalah-Adalan

You could fork the repo and debug deeper. I have similar issues and came to line 23 of Decipherer.cs I get an out of range exception on var signatureFunctionName = FindMatch(sourceCode, @"\.set\s*\(""signature""\s*,\s*([a-zA-Z0-9_$][\w$]*)\("); for this video https://youtu.be/K5KAc5CoCuk I do not know if the regex should match this part of the source string: .set(k.sp||"signature",EK(k.s)) because the regex seems to need an update

jphellemons avatar Mar 16 '18 10:03 jphellemons