flagbug / YoutubeExtractor

A .NET library, that allows to download videos from YouTube and/or extract their audio track (currently only for flash videos).
814 stars 375 forks source link

Only Downloads Some Videos. #301

Open Koolkuts1 opened 6 years ago

Koolkuts1 commented 6 years ago

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 commented 6 years ago

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.

jphellemons commented 6 years ago

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