Example #1
0
        private async void ExtractM3u8(string url)
        {
            isExtracting = true;
            extractor    = new M3u8Extractor(url);

            if (extractor.IsUrlValid())
            {
                Informations info = null;

                await Task.Run(() =>
                {
                    info = extractor.GetInformations();

                    if (info != null)
                    {
                        bool isFOD = info.department.Equals(FOD) ? true : false;
                        info.url   = extractor.GetM3u8Url(isFOD);
                    }
                });

                if (info != null)
                {
                    ListViewItem item = new ListViewItem(info.ToArray());
                    item.UseItemStyleForSubItems = false;
                    Font f = new Font(item.Font.Name, item.Font.Size + 8);
                    item.SubItems[0].Font      = f;
                    item.SubItems[0].ForeColor = Color.Green;

                    DownloadList.Items.Add(item);
                }
            }

            extractor.DestroyDriver();
            extractor = null;

            if (extractUrls.Count > 0)
            {
                ExtractM3u8(extractUrls.Dequeue());
            }

            isExtracting = false;
        }
Example #2
0
 private void Main_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     extractor.DestroyDriver();
     extractor = null;
 }