From aac8a23761c5cee4b98562e337ecc427324e69f0 Mon Sep 17 00:00:00 2001 From: Chay Date: Sat, 22 Aug 2020 01:28:33 -0400 Subject: [PATCH] Update Download.cs --- CS/Sites/VidStreaming/Download.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/CS/Sites/VidStreaming/Download.cs b/CS/Sites/VidStreaming/Download.cs index 1451719..5fa1735 100644 --- a/CS/Sites/VidStreaming/Download.cs +++ b/CS/Sites/VidStreaming/Download.cs @@ -36,11 +36,21 @@ public static class Download public static void StartDownload() { dwS = true; - - for(uint idx = 0; idx < downloadLinks.Length - 1; idx++) + int i = 0; + /*foreach(Char[] ca in downloadLinks) { - Thread ab = new Thread(() => MultiDownload(VidStreamingMain.extractDownloadUri(new string(downloadLinks[idx])))); - ab.Name = idx.ToString(); + Thread ab = new Thread(() => MultiDownload(VidStreamingMain.extractDownloadUri(new string(ca)))); + ab.Name = i.ToString(); + iThreads = iThreads.push_back(ab); + ab.Start(); + cDownloads++; + i++; + }*/ + for(uint idx = 0; idx != downloadLinks.Length; idx++) + { + string ix = new string(downloadLinks[idx]); + Thread ab = new Thread(() => MultiDownload(VidStreamingMain.extractDownloadUri(ix))); + ab.Name = (idx).ToString(); iThreads = iThreads.push_back(ab); ab.Start(); cDownloads++; @@ -144,7 +154,7 @@ private static Boolean MDownloadVideo(string dirURI, WebClient wc, string id) AmountTs = broken.Length / 2; int top = Console.CursorTop; String path = dirURI.TrimToSlash(); - for (int idx = 0; idx < broken.Length; idx++) + for (int idx = 0; idx < broken.Length - 1; idx++) { switch (broken[idx][0]) {