Example #1
0
        private void getFileUrlButton_Click(object sender, EventArgs e)
        {
            GuiToUtil(generic);
            if (CheckFileUrlRegex())
            {

                if (String.IsNullOrEmpty(playListUrlResultTextBox.Text))
                    MessageBox.Show("PlaylistUrlResult is empty");
                else
                {
                    Dictionary<string, string> playList;
                    if (!String.IsNullOrEmpty(GetRegex(generic, "regEx_FileUrl")))
                        playList = generic.GetPlaybackOptions(playListUrlResultTextBox.Text);
                    else
                    {
                        playList = new Dictionary<string, string>();
                        playList.Add("url", playListUrlResultTextBox.Text);
                    }
                    ResultUrlComboBox.Items.Clear();

                    if (playList != null)
                        foreach (KeyValuePair<string, string> entry in playList)
                        {
                            PlaybackOption po = new PlaybackOption(entry);
                            if ((bool)GetProperty(generic, "getRedirectedFileUrl"))
                                po.Url = WebCache.Instance.GetRedirectedUrl(po.Url);
                            ResultUrlComboBox.Items.Add(po);
                        }

                    if (ResultUrlComboBox.Items.Count > 0)
                        ResultUrlComboBox.SelectedIndex = 0;
                }
            }
        }