static void Main(string[] args) { ADLCore.Alert.ADLUpdates.onSystemUpdate += WriteToConsole; ADLCore.Alert.ADLUpdates.onThreadDeclaration += ThreadManage; concurrentTasks = new cTasks(3, WriteToConsole); tasksRunning = new bool[3]; bufferw = Console.WindowHeight; buffer = new ExList <string>(bufferw - ((topBuffer - 1) * 2), true, true); Console.CursorVisible = true; new Thread(() => { ReadText(new Action <string[]>(CreateNewCommandInstance)); }).Start(); // Fire and forget. Thread.Sleep(100); WriteToConsole("Consider helping this project! https://github.com/vrienstudios/anime-dl"); }
protected override void OnNavigatedTo(NavigationEventArgs e) { ExList.LoadExercises(); }
private void ParseM3U() { bool flg = false; for (int idx = 0; idx < m3u8Info.Length; idx++) { if (!flg) { if (m3u8Info[idx][0] == '#' && m3u8Info[idx + 1][0] == '#') { headers.Add(m3u8Info[idx]); continue; } else { parts = new ExList <m3Object>((m3u8Info.Length / 2) - (headers.Count - 3), false); flg = true; idx--; continue; } } if (idx == m3u8Info.Length - 1) { break; } parts.push_back(new m3Object(m3u8Info[idx], m3u8Info[idx + 1].IsValidUri() ? m3u8Info[idx + 1] : $"{bPath}/{m3u8Info[idx + 1]}")); idx++; } for (int idx = 0; idx < headers.Count; idx++) { string[] a = headers[idx].Replace("\"", string.Empty).Split(':'); switch (a[0]) { case "#EXT-X-KEY": { encrypted = true; string[] mkpair = a[1].Split(','); mkpair[0] = mkpair[0].SkipCharSequence("METHOD=".ToCharArray()); switch (mkpair[0]) { case "AES-128": encType = encrpytionType.AES128; break; default: throw new Exception("There's no decryption support for this encryption method at the moment."); } webClient.Headers = collection; encKey = webClient.DownloadString(mkpair[1].SkipCharSequence("URI=".ToCharArray()) + $":{a[2]}"); break; } case "#EXT-X-TARGETDURATION": duration = int.Parse(a[1]); break; } } Size = parts.Size; }