//------------------------------------------------------------------------------------
        private void MoreForm_Load(object sender, EventArgs e)
        {
            if (Uri.IsWellFormedUriString(SelectedMovie.Poster, UriKind.Absolute))
            {
                Poster.Load(SelectedMovie.Poster);
            }

            var mr = new MovieResponse();

            try
            {
                DBConnect.GetResponse("i", SelectedMovie.imdbID, ref mr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            Movie movie = mr as Movie;

            labelTitle.Text = movie.Title;
            MyLabel LabelMore = new MyLabel();

            tableLayoutPanel1.Controls.Add(LabelMore);
            LabelMore.Dock = DockStyle.Fill;

            LabelMore.Text = movie.ToString();

            buttonOK.Focus();
        }
        //------------------------------------------------------------------------------------
        private void SearchButton_Click(object sender, EventArgs e)
        {
            shortMList.Clear();

            var mr = new MovieResponse();

            try
            {
                DBConnect.GetResponse("s", Title.Text.Trim(), ref mr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MoreButton.Enabled = false;
            }

            SearchMovie ms = mr as SearchMovie;

            foreach (var item in ms.Search)
            {
                shortMList.Add(item);
            }

            MovieListBox.DataSource = null;
            MovieListBox.DataSource = shortMList;
            MoreButton.Enabled      = true;
            MovieListBox.Focus();
            MovieListBox.SelectedIndex = 0;
            if (Uri.IsWellFormedUriString(shortMList[0].Poster, UriKind.Absolute))
            {
                Poster.Load(shortMList[0].Poster);
            }
        }
 //------------------------------------------------------------------------------------
 private void MovieListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (shortMList.Count > 0)
     {
         if (MovieListBox.SelectedIndex != -1)
         {
             var PosterUri = shortMList[MovieListBox.SelectedIndex].Poster;
             if (Uri.IsWellFormedUriString(PosterUri, UriKind.Absolute))
             {
                 Poster.Load(PosterUri);
             }
             else
             {
                 Poster.Image = null;
             }
         }
     }
 }
Beispiel #4
0
        private void GetB_Click(object sender, EventArgs e)
        {
            string filmType;
            string FilmId;
            string VoiceId;

            Match regex = Regex.Match(UrlTB.Text, "(.*)\\/(.*)\\/(.*)\\/play\\?stream=(.*)");

            if (regex.Success)
            {
                filmType = regex.Groups[2].Value;
                FilmId   = regex.Groups[3].Value;
                VoiceId  = regex.Groups[4].Value;
            }
            else
            {
                MessageBox.Show("Error!" + Environment.NewLine + "Enter a valid URL", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            using (HttpRequest request = new HttpRequest()
            {
                UserAgent = "Mozilla/5.0",
                Cookies = Globals.Cookie
            })
            {
                try
                {
                    #region MainInfo
                    var     filmFullInfo = request.Get($"{Globals.SiteURL}/api/mobile/v1/{filmType}s/{FilmId}.json");
                    dynamic film         = JObject.Parse(filmFullInfo.ToString());

                    Poster.Load(Globals.SiteURL + film[filmType]["poster"]["medium"]);
                    FilmType.Text = filmType;

                    var filmVideo = request.Get($"{Globals.SiteURL}/api/mobile/v1/streaming/{filmType}s/{FilmId}/{Regex.Replace(VoiceId, "&season", "?season")}");
                    film = JObject.Parse(filmVideo.ToString());

                    FilmName.Text = film["title"];
                    #endregion

                    if (MP4rb.Checked)
                    {
                        if (film["media_files"]["mp4"] != null)
                        {
                            if (((string)film["media_files"]["mp4"]).StartsWith("http"))
                            {
                                ResultTB.Text = film["media_files"]["mp4"];
                            }
                            else
                            {
                                ResultTB.Text = "https:" + film["media_files"]["mp4"];
                            }

                            FilmMp4URL = ResultTB.Text;

                            #region Create FilmFormats

                            JObject filmFormats = JObject.Parse(request.Get(FilmMp4URL).ToString());

                            FormatMp4 = new FilmFormats()
                            {
                                FullHD = (string)filmFormats["1080"],
                                HD     = (string)filmFormats["720"],
                                Normal = (string)filmFormats["480"],
                                Zepa   = (string)filmFormats["360"]
                            };

                            if (FormatMp4.FullHD != null)
                            {
                                Qu1080.Visible = true;
                            }
                            if (FormatMp4.HD != null)
                            {
                                Qu720.Visible = true;
                            }
                            if (FormatMp4.Normal != null)
                            {
                                Qu480.Visible = true;
                            }
                            if (FormatMp4.Zepa != null)
                            {
                                Qu360.Visible = true;
                            }
                            #endregion

                            ParsePanel.Visible = true;
                        }
                        else
                        {
                            ResultTB.Text = "Nothing";
                        }
                    }
                    else
                    {
                        if (film["media_files"]["hls"] != null)
                        {
                            if (((string)film["media_files"]["hls"]).StartsWith("http"))
                            {
                                ResultTB.Text = film["media_files"]["hls"];
                            }
                            else
                            {
                                ResultTB.Text = "https:" + film["media_files"]["hls"];
                            }
                        }
                        else
                        {
                            ResultTB.Text = "Nothing";
                        }
                        ParsePanel.Visible = false;
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Woops! Something went wrong, contact the developer and send a screenshot of this window." + Environment.NewLine + ex.Message, "ERROR!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }