Created
December 29, 2016 21:15
-
-
Save JKamsker/903f331ab7ebf9a40de4e4ce723044da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void use(string[] args) | |
{ | |
var dat = new YoutubeProvider(args.Length != 0 ? args[0] : "https://www.youtube.com/watch?v=IxuEtL7gxoM"); | |
var dat1 = new YoutubeProvider(args.Length > 1 ? args[1] : "https://www.youtube.com/watch?v=VmUGe8KDdGI"); | |
while (!dat.hasFinished || !dat1.hasFinished) | |
{ | |
WaitHandle.WaitAny(new[] { dat.waiter, dat1.waiter }, -1); | |
// dat.WaitOne(); for one or "WaitHandle.WaitAny(new[] { dat.waiter, dat1.waiter }, -1);" for multible downloads | |
Console.WriteLine("1: {0}%, {1} secs remaining", dat.percentage.ToString("0.0"), dat.eta.TotalSeconds); | |
Console.WriteLine("2: {0}%, {1} secs remaining", dat1.percentage.ToString("0.0"), dat1.eta.TotalSeconds); | |
} | |
File.WriteAllText(dat.saveto + ".log", dat.rawResponse); | |
Console.WriteLine("Finished"); | |
Console.ReadLine(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment