Beispiel #1
0
        static void getMoviesPerPage(Bunifu.Framework.UI.BunifuCheckbox UpdateCheck, System.Windows.Forms.PictureBox preview, List <string> URLs, string table_db, Bunifu.Framework.UI.BunifuCustomDataGrid dataGrid)
        {
            foreach (string URL in URLs)
            {
                HtmlWeb browser = new HtmlWeb();
                try
                {
                    Console.WriteLine(URL);
                    HtmlDocument doc      = browser.Load(URL);
                    Regex        pattern0 = new Regex(@"\(.*\)");
                    string       title    = doc.DocumentNode.SelectSingleNode("//h2[@class='heading']").InnerText.Trim();
                    title = pattern0.Replace(title, "").Trim();
                    Movie movie = Information.getTMDB_Movie(Information.getTMDBId_movie(title), "fr-FR");
                    if (movie == null)
                    {
                        continue;
                    }

                    preview.ImageLocation = "https://image.tmdb.org/t/p/w300_and_h450_bestv2" + movie.poster_path;
                    // ---- get streams ------
                    List <string> streams = getMovieStreams(doc, browser, URL);
                    // ---- save into db ------
                    Information.dumpMovie_db(UpdateCheck, movie, streams, table_db, dataGrid);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
        }
 private void setCheckboxValue(Bunifu.Framework.UI.BunifuCheckbox cb, bool value)
 {
     cb.Invoke((MethodInvoker)(() =>
     {
         cb.Checked = value;
     }));
 }
Beispiel #3
0
 public static void dumpMovie_db(Bunifu.Framework.UI.BunifuCheckbox UpdateCheck, Movie movie, List <string> streams, string table_db, Bunifu.Framework.UI.BunifuCustomDataGrid dataGrid)
 {
     if (!DataExist_db(movie.id.ToString(), table_db))
     {
         //---- insertion
         Console.WriteLine("insert");
         insertMovie(movie, table_db, streams);
         if (dataGrid.InvokeRequired)
         {
             dataGrid.Invoke(new Action(() => dataGrid.Rows.Add(movie.title, "INSERTED")));
         }
     }
     else
     {
         if (UpdateCheck.Checked)
         {
             //---- update
             Console.WriteLine("update");
             UpdateMovie(streams, movie.id, table_db);
             if (dataGrid.InvokeRequired)
             {
                 dataGrid.Invoke(new Action(() => dataGrid.Rows.Add(movie.title, "UPDATED")));
             }
         }
     }
 }
Beispiel #4
0
        public static Task getAllTV(Bunifu.Framework.UI.BunifuCheckbox UpdateCheck, System.Windows.Forms.PictureBox preview, Bunifu.Framework.UI.BunifuFlatButton Start, Bunifu.Framework.UI.BunifuFlatButton Stop, Bunifu.Framework.UI.BunifuCircleProgressbar Progress, Stream_Scraper.Form1.StopWatch Watch, Bunifu.Framework.UI.BunifuCustomDataGrid dataGrid, System.Windows.Forms.Label Total, System.Windows.Forms.Label Scraped, string url, string table_db, string seasons_db, string stream_db)
        {
            int PagesCount = getPagesCount(url);

            Total.Invoke(new Action(() => Total.Text = PagesCount.ToString()));
            for (int i = 1; i <= PagesCount; i++)
            {
                List <string> TVURLs = null;


                if (i == 1)
                {
                    TVURLs = getTVsURLs($"https://libertyvf.co/series/");
                }
                else
                {
                    TVURLs = getTVsURLs($"https://libertyvf.co/series/page-{i}.html");
                }
                getTVPerPage(preview, TVURLs, table_db, seasons_db, stream_db, dataGrid, UpdateCheck);
                Scraped.Invoke(new Action(() => Scraped.Text = i.ToString()));
            }
            Start.Invoke(new Action(() => Start.Enabled        = true));
            Stop.Invoke(new Action(() => Stop.Enabled          = false));
            Progress.Invoke(new Action(() => Progress.animated = false));
            Progress.Invoke(new Action(() => Progress.Visible  = false));
            return(null);
        }
Beispiel #5
0
 private void uncheck(Bunifu.Framework.UI.BunifuCheckbox Check)
 {
     foreach (Bunifu.Framework.UI.BunifuCheckbox c in Checks)
     {
         if (c.Name == Check.Name)
         {
             continue;
         }
         c.Checked = false;
     }
 }
Beispiel #6
0
 private void MyCheckbox_OnChange(object sender, EventArgs e)
 {
     Bunifu.Framework.UI.BunifuCheckbox Checkbox = sender as Bunifu.Framework.UI.BunifuCheckbox;
     if (Checkbox.Checked)
     {
         CheckBoxList.Add(Checkbox);
     }
     else
     {
         CheckBoxList.Remove(Checkbox);
     }
     //throw new NotImplementedException();
 }
        public static Task getAllMovies(Bunifu.Framework.UI.BunifuCheckbox UpdateCheck, System.Windows.Forms.PictureBox preview, Bunifu.Framework.UI.BunifuFlatButton Start, Bunifu.Framework.UI.BunifuFlatButton Stop, Bunifu.Framework.UI.BunifuCircleProgressbar Progress, Stream_Scraper.Form1.StopWatch Watch, Bunifu.Framework.UI.BunifuCustomDataGrid dataGrid, System.Windows.Forms.Label Total, System.Windows.Forms.Label Scraped, string url, string table_db, string stream_db)
        {
            int PagesCount = getPagesCount(url);

            Total.Invoke(new Action(() => Total.Text = PagesCount.ToString()));

            for (int i = 1; i <= PagesCount; i++)
            {
                try {
                    List <string> moviesURLs = null;

                    moviesURLs = getMoviesURLs($"https://french-film.co/film-streaming/page/{i}/");
                    getMoviesPerPage(UpdateCheck, preview, moviesURLs, table_db, stream_db, dataGrid);
                    Scraped.Invoke(new Action(() => Scraped.Text = i.ToString()));
                }
                catch { }
            }
            Start.Invoke(new Action(() => Start.Enabled        = true));
            Stop.Invoke(new Action(() => Stop.Enabled          = false));
            Progress.Invoke(new Action(() => Progress.animated = false));
            Progress.Invoke(new Action(() => Progress.Visible  = false));
            return(null);
        }
Beispiel #8
0
        public ChoixDesLiaisons()
        {
            InitializeComponent();
            //RangementDeChoix.Hide();

            int i = 0;
            int stat;

            while (i < Form1.NombreDeRouter)
            {
                stat = 1;
                //215,100
                TableLayoutPanel MyTable = new TableLayoutPanel();
                MyTable.Size        = new Size(300, 100);
                MyTable.ColumnCount = 2;
                MyTable.RowCount    = 1;
                MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
                MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
                MyTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 100F));
                MyTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;

                Bunifu.UI.WinForms.BunifuPictureBox MyPicture = new Bunifu.UI.WinForms.BunifuPictureBox();
                MyPicture.Size  = new Size(50, 50);
                MyPicture.Image = Properties.Resources.SoftwareTools7;

                Label MyLabel = new Label();
                MyLabel.Text = "Router" + (i + 1);

                FlowLayoutPanel MyFlowPanel1 = new FlowLayoutPanel();
                MyFlowPanel1.FlowDirection = FlowDirection.TopDown;
                MyFlowPanel1.AutoScroll    = true;
                MyFlowPanel1.WrapContents  = false;
                MyFlowPanel1.Controls.Add(MyPicture);
                MyFlowPanel1.Controls.Add(MyLabel);
                MyTable.Controls.Add(MyFlowPanel1, 0, 0);

                FlowLayoutPanel MyFlowPanel2 = new FlowLayoutPanel();
                MyFlowPanel2.FlowDirection = FlowDirection.TopDown;
                MyFlowPanel2.AutoScroll    = true;
                MyFlowPanel2.WrapContents  = false;


                while (stat <= Form1.NombreDeRouter)
                {
                    if ((i + 1) == stat)
                    {
                        stat++;
                    }
                    else
                    {
                        Bunifu.Framework.UI.BunifuCheckbox MyCheckbox = new Bunifu.Framework.UI.BunifuCheckbox();
                        MyCheckbox.Checked = false;
                        MyCheckbox.Tag     = "" + stat;

                        Label MyLabel2 = new Label();
                        MyLabel2.Text = "Router" + stat;

                        MyFlowPanel2.Controls.Add(MyCheckbox);
                        MyFlowPanel2.Controls.Add(MyLabel2);
                        stat++;
                    }
                }
                MyTable.Controls.Add(MyFlowPanel2, 1, 0);
                LiaisonMainFlow.Controls.Add(MyTable);
                i++;
            }
        }
Beispiel #9
0
        public void LoadLegend(SortedDictionary <int, float> totalall)
        {
            FoodDrinkBLL foodDrinkBLL             = new FoodDrinkBLL();
            Dictionary <string, float> lsFoodName = new Dictionary <string, float>();

            foreach (var item in totalall)
            {
                string name = foodDrinkBLL.GetFoodDrinkName(item.Key);
                if (name != null)
                {
                    lsFoodName[name] = item.Value;
                }
            }

            int count = 1;
            int x = 0, y = 0, z = 0;
            int pX = 3, pY = 5;

            foreach (var item in lsFoodName)
            {
                if (count > 5)
                {
                    break;
                }
                Bunifu.Framework.UI.BunifuCheckbox cb1 = new Bunifu.Framework.UI.BunifuCheckbox();

                //Chart1.colorSet.Add(Color.FromArgb(255, 128, 255));
                //Chart1.colorSet.Add(Color.FromArgb(128, 128, 255));
                //Chart1.colorSet.Add(Color.FromArgb(128, 255, 255));
                //Chart1.colorSet.Add(Color.FromArgb(128, 255, 128));
                //Chart1.colorSet.Add(Color.FromArgb(255, 255, 128));
                if (count == 1)
                {
                    //55, 101, 177
                    x = 255; y = 128; z = 255;
                }
                if (count == 2)
                {
                    //87, 151, 255
                    x = 128; y = 128; z = 255;
                }
                if (count == 3)
                {
                    //17, 128, 193
                    x = 201; y = 255; z = 255;
                }
                if (count == 4)
                {
                    //241, 77, 255
                    x = 255; y = 192; z = 128;
                }
                if (count == 5)
                {
                    //148, 38, 131
                    x = 255; y = 255; z = 128;
                }
                count++;
                cb1.BackColor       = Color.FromArgb(x, y, z);
                cb1.CheckedOnColor  = Color.FromArgb(x, y, z);
                cb1.ChechedOffColor = Color.FromArgb(x, y, z);
                cb1.Size            = new Size(20, 20);
                cb1.ForeColor       = Color.FromArgb(x, y, z);
                cb1.Location        = new Point(pX, pY);

                Label lName = new Label();
                lName.Text     = item.Key;
                lName.Location = new Point(pX + 26, pY);



                Label lPercent = new Label();
                lPercent.Text     = item.Value.ToString();
                lPercent.AutoSize = false;
                lPercent.Size     = new Size(80, 23);
                lPercent.Location = new Point(pX + 132, pY);


                panelLegend.Controls.Add(cb1);
                panelLegend.Controls.Add(lName);
                // panelLegend.Controls.Add(lPercent);

                pY += 26;
            }
        }
Beispiel #10
0
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Login));
     this.label1             = new System.Windows.Forms.Label();
     this.panel1             = new System.Windows.Forms.Panel();
     this.bunifuCustomLabel5 = new Bunifu.Framework.UI.BunifuCustomLabel();
     this.bunifuCustomLabel4 = new Bunifu.Framework.UI.BunifuCustomLabel();
     this.pictureBox1        = new System.Windows.Forms.PictureBox();
     this.bunifuCustomLabel2 = new Bunifu.Framework.UI.BunifuCustomLabel();
     this.bunifuSeparator1   = new Bunifu.Framework.UI.BunifuSeparator();
     this.bunifuCheckbox1    = new Bunifu.Framework.UI.BunifuCheckbox();
     this.bunifuCustomLabel1 = new Bunifu.Framework.UI.BunifuCustomLabel();
     this.panel4             = new System.Windows.Forms.Panel();
     this.panel3             = new System.Windows.Forms.Panel();
     this.button1            = new Bunifu.Framework.UI.BunifuThinButton2();
     this.textBox1           = new Bunifu.Framework.UI.BunifuMaterialTextbox();
     this.textBox2           = new Bunifu.Framework.UI.BunifuMaterialTextbox();
     this.bunifuCustomLabel6 = new Bunifu.Framework.UI.BunifuCustomLabel();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.AutoSize  = true;
     this.label1.BackColor = System.Drawing.Color.White;
     this.label1.Font      = new System.Drawing.Font("Century Gothic", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.ForeColor = System.Drawing.Color.Red;
     this.label1.Location  = new System.Drawing.Point(486, 244);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(20, 16);
     this.label1.TabIndex  = 38;
     this.label1.Text      = "    ";
     //
     // panel1
     //
     this.panel1.BackgroundImage       = ((System.Drawing.Image)(resources.GetObject("panel1.BackgroundImage")));
     this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.panel1.Controls.Add(this.bunifuCustomLabel5);
     this.panel1.Controls.Add(this.bunifuCustomLabel4);
     this.panel1.Controls.Add(this.pictureBox1);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Left;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(400, 500);
     this.panel1.TabIndex = 46;
     //
     // bunifuCustomLabel5
     //
     this.bunifuCustomLabel5.AutoSize  = true;
     this.bunifuCustomLabel5.BackColor = System.Drawing.Color.Transparent;
     this.bunifuCustomLabel5.Font      = new System.Drawing.Font("Segoe UI Semilight", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.bunifuCustomLabel5.ForeColor = System.Drawing.Color.Black;
     this.bunifuCustomLabel5.Location  = new System.Drawing.Point(60, 350);
     this.bunifuCustomLabel5.Name      = "bunifuCustomLabel5";
     this.bunifuCustomLabel5.Size      = new System.Drawing.Size(294, 28);
     this.bunifuCustomLabel5.TabIndex  = 46;
     this.bunifuCustomLabel5.Text      = "With Billing and Collection System";
     //
     // bunifuCustomLabel4
     //
     this.bunifuCustomLabel4.AutoSize  = true;
     this.bunifuCustomLabel4.BackColor = System.Drawing.Color.Transparent;
     this.bunifuCustomLabel4.Font      = new System.Drawing.Font("Segoe UI Semilight", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.bunifuCustomLabel4.ForeColor = System.Drawing.Color.Black;
     this.bunifuCustomLabel4.Location  = new System.Drawing.Point(25, 306);
     this.bunifuCustomLabel4.Name      = "bunifuCustomLabel4";
     this.bunifuCustomLabel4.Size      = new System.Drawing.Size(363, 28);
     this.bunifuCustomLabel4.TabIndex  = 47;
     this.bunifuCustomLabel4.Text      = "Service Monitoring and Product Inventory";
     //
     // pictureBox1
     //
     this.pictureBox1.BackColor = System.Drawing.Color.Transparent;
     this.pictureBox1.Image     = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
     this.pictureBox1.Location  = new System.Drawing.Point(86, 24);
     this.pictureBox1.Name      = "pictureBox1";
     this.pictureBox1.Size      = new System.Drawing.Size(219, 217);
     this.pictureBox1.SizeMode  = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex  = 45;
     this.pictureBox1.TabStop   = false;
     //
     // bunifuCustomLabel2
     //
     this.bunifuCustomLabel2.AutoSize  = true;
     this.bunifuCustomLabel2.Font      = new System.Drawing.Font("Segoe UI Semilight", 35F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.bunifuCustomLabel2.ForeColor = System.Drawing.Color.Black;
     this.bunifuCustomLabel2.Location  = new System.Drawing.Point(406, 9);
     this.bunifuCustomLabel2.Name      = "bunifuCustomLabel2";
     this.bunifuCustomLabel2.Size      = new System.Drawing.Size(140, 62);
     this.bunifuCustomLabel2.TabIndex  = 47;
     this.bunifuCustomLabel2.Text      = "Login";
     //
     // bunifuSeparator1
     //
     this.bunifuSeparator1.BackColor     = System.Drawing.Color.Transparent;
     this.bunifuSeparator1.LineColor     = System.Drawing.Color.FromArgb(((int)(((byte)(105)))), ((int)(((byte)(105)))), ((int)(((byte)(105)))));
     this.bunifuSeparator1.LineThickness = 1;
     this.bunifuSeparator1.Location      = new System.Drawing.Point(401, 60);
     this.bunifuSeparator1.Name          = "bunifuSeparator1";
     this.bunifuSeparator1.Size          = new System.Drawing.Size(405, 35);
     this.bunifuSeparator1.TabIndex      = 48;
     this.bunifuSeparator1.Transparency  = 255;
     this.bunifuSeparator1.Vertical      = false;
     //
     // bunifuCheckbox1
     //
     this.bunifuCheckbox1.BackColor       = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(53)))), ((int)(((byte)(125)))));
     this.bunifuCheckbox1.ChechedOffColor = System.Drawing.Color.FromArgb(((int)(((byte)(132)))), ((int)(((byte)(135)))), ((int)(((byte)(140)))));
     this.bunifuCheckbox1.Checked         = true;
     this.bunifuCheckbox1.CheckedOnColor  = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(53)))), ((int)(((byte)(125)))));
     this.bunifuCheckbox1.ForeColor       = System.Drawing.Color.White;
     this.bunifuCheckbox1.Location        = new System.Drawing.Point(459, 330);
     this.bunifuCheckbox1.Name            = "bunifuCheckbox1";
     this.bunifuCheckbox1.Size            = new System.Drawing.Size(20, 20);
     this.bunifuCheckbox1.TabIndex        = 51;
     //
     // bunifuCustomLabel1
     //
     this.bunifuCustomLabel1.AutoSize  = true;
     this.bunifuCustomLabel1.Font      = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.bunifuCustomLabel1.ForeColor = System.Drawing.Color.Black;
     this.bunifuCustomLabel1.Location  = new System.Drawing.Point(485, 329);
     this.bunifuCustomLabel1.Name      = "bunifuCustomLabel1";
     this.bunifuCustomLabel1.Size      = new System.Drawing.Size(112, 21);
     this.bunifuCustomLabel1.TabIndex  = 52;
     this.bunifuCustomLabel1.Text      = "Remember me";
     //
     // panel4
     //
     this.panel4.BackgroundImage       = ((System.Drawing.Image)(resources.GetObject("panel4.BackgroundImage")));
     this.panel4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.panel4.Location = new System.Drawing.Point(450, 215);
     this.panel4.Name     = "panel4";
     this.panel4.Size     = new System.Drawing.Size(29, 25);
     this.panel4.TabIndex = 49;
     //
     // panel3
     //
     this.panel3.BackgroundImage       = ((System.Drawing.Image)(resources.GetObject("panel3.BackgroundImage")));
     this.panel3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.panel3.Location = new System.Drawing.Point(447, 140);
     this.panel3.Name     = "panel3";
     this.panel3.Size     = new System.Drawing.Size(32, 32);
     this.panel3.TabIndex = 50;
     //
     // button1
     //
     this.button1.ActiveBorderThickness = 1;
     this.button1.ActiveCornerRadius    = 20;
     this.button1.ActiveFillColor       = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(53)))), ((int)(((byte)(125)))));
     this.button1.ActiveForecolor       = System.Drawing.Color.White;
     this.button1.ActiveLineColor       = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(53)))), ((int)(((byte)(125)))));
     this.button1.BackColor             = System.Drawing.Color.White;
     this.button1.BackgroundImage       = ((System.Drawing.Image)(resources.GetObject("button1.BackgroundImage")));
     this.button1.ButtonText            = "Sign in";
     this.button1.Cursor              = System.Windows.Forms.Cursors.Hand;
     this.button1.Font                = new System.Drawing.Font("Segoe UI Semibold", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button1.ForeColor           = System.Drawing.Color.SeaGreen;
     this.button1.IdleBorderThickness = 1;
     this.button1.IdleCornerRadius    = 10;
     this.button1.IdleFillColor       = System.Drawing.Color.White;
     this.button1.IdleForecolor       = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(53)))), ((int)(((byte)(125)))));
     this.button1.IdleLineColor       = System.Drawing.Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(53)))), ((int)(((byte)(125)))));
     this.button1.Location            = new System.Drawing.Point(617, 420);
     this.button1.Margin              = new System.Windows.Forms.Padding(5);
     this.button1.Name                = "button1";
     this.button1.Size                = new System.Drawing.Size(155, 52);
     this.button1.TabIndex            = 53;
     this.button1.TextAlign           = System.Drawing.ContentAlignment.MiddleCenter;
     this.button1.Click              += new System.EventHandler(this.button1_Click_1);
     //
     // textBox1
     //
     this.textBox1.BackColor           = System.Drawing.Color.White;
     this.textBox1.Cursor              = System.Windows.Forms.Cursors.IBeam;
     this.textBox1.Font                = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.textBox1.ForeColor           = System.Drawing.SystemColors.ActiveCaptionText;
     this.textBox1.HintForeColor       = System.Drawing.Color.Empty;
     this.textBox1.HintText            = "";
     this.textBox1.isPassword          = false;
     this.textBox1.LineFocusedColor    = System.Drawing.Color.Lime;
     this.textBox1.LineIdleColor       = System.Drawing.Color.Blue;
     this.textBox1.LineMouseHoverColor = System.Drawing.Color.Blue;
     this.textBox1.LineThickness       = 3;
     this.textBox1.Location            = new System.Drawing.Point(479, 139);
     this.textBox1.Margin              = new System.Windows.Forms.Padding(4);
     this.textBox1.Name                = "textBox1";
     this.textBox1.Size                = new System.Drawing.Size(270, 33);
     this.textBox1.TabIndex            = 54;
     this.textBox1.Text                = "Username";
     this.textBox1.TextAlign           = System.Windows.Forms.HorizontalAlignment.Left;
     this.textBox1.Enter              += new System.EventHandler(this.textBox1_Enter);
     this.textBox1.KeyDown            += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
     //
     // textBox2
     //
     this.textBox2.BackColor           = System.Drawing.Color.White;
     this.textBox2.Cursor              = System.Windows.Forms.Cursors.IBeam;
     this.textBox2.Font                = new System.Drawing.Font("Century Gothic", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.textBox2.ForeColor           = System.Drawing.SystemColors.ActiveCaptionText;
     this.textBox2.HintForeColor       = System.Drawing.Color.Empty;
     this.textBox2.HintText            = "";
     this.textBox2.isPassword          = false;
     this.textBox2.LineFocusedColor    = System.Drawing.Color.Lime;
     this.textBox2.LineIdleColor       = System.Drawing.Color.Blue;
     this.textBox2.LineMouseHoverColor = System.Drawing.Color.Blue;
     this.textBox2.LineThickness       = 3;
     this.textBox2.Location            = new System.Drawing.Point(479, 207);
     this.textBox2.Margin              = new System.Windows.Forms.Padding(4);
     this.textBox2.Name                = "textBox2";
     this.textBox2.Size                = new System.Drawing.Size(270, 33);
     this.textBox2.TabIndex            = 55;
     this.textBox2.Text                = "Password";
     this.textBox2.TextAlign           = System.Windows.Forms.HorizontalAlignment.Left;
     this.textBox2.Enter              += new System.EventHandler(this.textBox2_Enter);
     this.textBox2.KeyDown            += new System.Windows.Forms.KeyEventHandler(this.textBox2_KeyDown);
     this.textBox2.KeyPress           += new System.Windows.Forms.KeyPressEventHandler(this.textBox2_KeyPress);
     //
     // bunifuCustomLabel6
     //
     this.bunifuCustomLabel6.AutoSize = true;
     this.bunifuCustomLabel6.Cursor   = System.Windows.Forms.Cursors.Hand;
     this.bunifuCustomLabel6.Font     = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.bunifuCustomLabel6.Location = new System.Drawing.Point(778, 2);
     this.bunifuCustomLabel6.Name     = "bunifuCustomLabel6";
     this.bunifuCustomLabel6.Size     = new System.Drawing.Size(20, 21);
     this.bunifuCustomLabel6.TabIndex = 56;
     this.bunifuCustomLabel6.Text     = "X";
     this.bunifuCustomLabel6.Click   += new System.EventHandler(this.bunifuCustomLabel6_Click);
     //
     // Login
     //
     this.BackColor             = System.Drawing.Color.White;
     this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.ClientSize            = new System.Drawing.Size(800, 500);
     this.Controls.Add(this.bunifuCustomLabel6);
     this.Controls.Add(this.textBox1);
     this.Controls.Add(this.textBox2);
     this.Controls.Add(this.button1);
     this.Controls.Add(this.bunifuCheckbox1);
     this.Controls.Add(this.bunifuCustomLabel1);
     this.Controls.Add(this.panel4);
     this.Controls.Add(this.panel3);
     this.Controls.Add(this.bunifuCustomLabel2);
     this.Controls.Add(this.bunifuSeparator1);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.label1);
     this.DoubleBuffered  = true;
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.Name            = "Login";
     this.StartPosition   = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Load           += new System.EventHandler(this.Login_Load);
     this.Enter          += new System.EventHandler(this.Login_Enter);
     this.panel1.ResumeLayout(false);
     this.panel1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Beispiel #11
0
 static void getTVPerPage(System.Windows.Forms.PictureBox preview, List <string> URLs, string table_db, string seasons_db, string stream_db, Bunifu.Framework.UI.BunifuCustomDataGrid dataGrid, Bunifu.Framework.UI.BunifuCheckbox UpdateCheck)
 {
     foreach (string URL in URLs)
     {
         HtmlWeb browser = new HtmlWeb();
         try
         {
             Console.WriteLine(URL);
             HtmlDocument doc      = browser.Load(URL);
             Regex        pattern0 = new Regex(@"\(.*\)");
             string       title    = doc.DocumentNode.SelectSingleNode("//h2[@class='heading']").InnerText.Trim();
             title = pattern0.Replace(title, "").Trim();
             TV tv = Information.getTMDB_TV(Information.getTMDBId_TV(title), "fr-FR");
             if (tv == null)
             {
                 continue;
             }
             if (!Information.DataExist_db(tv.id.ToString(), table_db))
             {
                 Information.insertTV(tv, table_db);
             }
             if (dataGrid.InvokeRequired)
             {
                 dataGrid.Invoke(new Action(() => dataGrid.Rows.Add(title, "UPDATED")));
             }
             preview.ImageLocation = "https://image.tmdb.org/t/p/w300_and_h450_bestv2" + tv.poster_path;
             //-- get seasons episodes <Season,<Episode,Streams>>
             Dictionary <int, Dictionary <int, List <string> > > tvData = getTVData(URL);
             // ---- save into db ------
             Information.dumpSeasonsEpisodes_db(tv, tvData, seasons_db, stream_db, "fr-FR", UpdateCheck);
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
         }
     }
 }
Beispiel #12
0
        private void Panel_Liaison_Content()
        {
            int i = 0;
            int stat;

            while (i < NombreDeRouter)
            {
                stat = 1;
                //215,100
                TableLayoutPanel MyTable = new TableLayoutPanel();
                MyTable.Size        = new Size(1025, 100);
                MyTable.ColumnCount = 2;
                MyTable.RowCount    = 1;
                MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F));
                MyTable.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 80F));
                MyTable.RowStyles.Add(new RowStyle(SizeType.Absolute, 100F));
                MyTable.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;

                Bunifu.UI.WinForms.BunifuPictureBox MyPicture = new Bunifu.UI.WinForms.BunifuPictureBox();
                MyPicture.Size  = new Size(50, 50);
                MyPicture.Image = Properties.Resources.SoftwareTools7;

                Label MyLabel = new Label();
                MyLabel.Text = "Router" + (i + 1);

                FlowLayoutPanel MyFlowPanel1 = new FlowLayoutPanel();
                MyFlowPanel1.FlowDirection = FlowDirection.TopDown;
                MyFlowPanel1.AutoScroll    = true;
                MyFlowPanel1.WrapContents  = false;
                MyFlowPanel1.Controls.Add(MyPicture);
                MyFlowPanel1.Controls.Add(MyLabel);
                MyTable.Controls.Add(MyFlowPanel1, 0, 0);

                FlowLayoutPanel MyFlowPanel2 = new FlowLayoutPanel();
                MyFlowPanel2.FlowDirection = FlowDirection.LeftToRight;
                MyFlowPanel2.AutoSize      = true;
                MyFlowPanel2.AutoScroll    = false;
                MyFlowPanel2.WrapContents  = true;


                while (stat <= NombreDeRouter)
                {
                    if ((i + 1) == stat)
                    {
                        stat++;
                    }
                    else
                    {
                        Bunifu.Framework.UI.BunifuCheckbox MyCheckbox = new Bunifu.Framework.UI.BunifuCheckbox();
                        MyCheckbox.Checked   = false;
                        MyCheckbox.Name      = "" + stat;
                        MyCheckbox.Tag       = "" + i;
                        MyCheckbox.OnChange += MyCheckbox_OnChange;
                        Label MyLabel2 = new Label();
                        MyLabel2.Text = "Router" + stat;

                        MyFlowPanel2.Controls.Add(MyCheckbox);
                        MyFlowPanel2.Controls.Add(MyLabel2);
                        //CheckBoxList.Add(MyCheckbox);
                        stat++;
                    }
                }
                MyTable.Controls.Add(MyFlowPanel2, 1, 0);
                LiaisonMainFlow.Controls.Add(MyTable);
                i++;
            }
        }
Beispiel #13
0
 public static void dumpSeasonsEpisodes_db(TV tv, Dictionary <int, Dictionary <int, List <string> > > Data, string season_db, string episode_db, string lang, Bunifu.Framework.UI.BunifuCheckbox UpdateCheck)
 {
     foreach (KeyValuePair <int, Dictionary <int, List <string> > > Season in Data)
     {
         //<summary>
         // insert season if missing
         //
         //<summary>
         if (!SeasonExist_db(tv.id, Season.Key, season_db))
         {
             InsertSeason(tv.id, tv.name, getSeasonDetails(tv.seasons, Season.Key), season_db);
         }
         //<summary>
         // Insert episodes
         // if update checked , update all streams
         // else insert new only
         //<summary>
         InsertEpisodes(tv.id, tv.name, Season.Key, Season.Value, episode_db, lang, UpdateCheck);
     }
 }
Beispiel #14
0
        static void InsertEpisodes(int tmdb, string tv_name, int Snumber, Dictionary <int, List <string> > EPs, string episode_db, string lang, Bunifu.Framework.UI.BunifuCheckbox UpdateCheck)
        {
            foreach (KeyValuePair <int, List <string> > EP in EPs)
            {
                if (EP.Value.Count == 0)
                {
                    goto None;
                }
                if (EpisodeExist_db(tmdb.ToString(), Snumber, EP.Key, episode_db))
                {
                    if (UpdateCheck.Checked)
                    {
                        //<summary>
                        // Update Episode
                        //<summary>
                        try
                        {
                            con.Open();
                            MySqlCommand cmd = new MySqlCommand();
                            cmd.Connection  = con;
                            cmd.CommandType = System.Data.CommandType.Text;
                            Regex pattern = new Regex("[\\\\\"]");

                            cmd.CommandText = $"UPDATE  {episode_db} SET streams =  '{string.Join("\n", filterLiveStreams(string.Join("\n", EP.Value.Select(s => pattern.Replace(s, "")))))}' "
                                              + $"WHERE tmdb ={tmdb} and season = {Snumber} and episode = {EP.Key}";

                            cmd.ExecuteNonQuery();
                            cmd.CommandText = $"UPDATE  {episode_db} SET posted =  0 "
                                              + $"WHERE tmdb ={tmdb} and season = {Snumber} and episode = {EP.Key}";

                            cmd.ExecuteNonQuery();
                        }
                        catch (Exception z) { Console.WriteLine(z.Message); }
                        finally { con.Close(); }
                    }
                }
                else
                {
                    //<summary>
                    // Insert New Episode
                    //<summary>
                    try
                    {
                        Episode e = getTMDB_Episode(tmdb.ToString(), lang, Snumber, EP.Key);
                        con.Open();
                        MySqlCommand cmd = new MySqlCommand();
                        cmd.Connection  = con;
                        cmd.CommandType = System.Data.CommandType.Text;
                        Regex pattern = new Regex("[\\\\\"]");

                        cmd.CommandText = $"INSERT INTO {episode_db} (tmdb,season,episode,overview,name,still_path,vote_average,vote_count,tv_title,air_date,streams,insert_time)"
                                          + "VALUES("
                                          + $@"{tmdb},"
                                          + $@"{Snumber},"
                                          + $@"{EP.Key},"
                                          + $@"'{e.overview.Replace(@"'", @"\'")}',"
                                          + $@"'{e.name.Replace(@"'", @"\'")}',"
                                          + $@"'{e.still_path}',"
                                          + $@"'{e.vote_average}',"
                                          + $@"'{e.vote_count}',"
                                          + $@"'{tv_name.Replace(@"'", @"\'")}',"
                                          + $@"'{e.air_date}',"
                                          + $@"'{string.Join("\n", filterLiveStreams(string.Join("\n", EP.Value.Select(s => pattern.Replace(s, "")))))}',"
                                          + $@"'{DateTime.Now.ToUniversalTime().ToString("yyyy-MM-dd hh:mm:ss")}'"

                                          + ")";
                        cmd.ExecuteNonQuery();
                    }
                    catch (Exception z) { Console.WriteLine(z.Message); }
                    finally { con.Close(); }
                }
            }
None:
            return;
        }
        static void getTVPerPage(System.Windows.Forms.PictureBox preview, List <string> URLs, string table_db, string seasons_db, string stream_db, Bunifu.Framework.UI.BunifuCustomDataGrid dataGrid, Bunifu.Framework.UI.BunifuCheckbox UpdateCheck)
        {
            foreach (string URL in URLs)
            {
                HtmlWeb browser = new HtmlWeb();
                try
                {
                    Console.WriteLine(URL);
                    HtmlDocument doc      = browser.Load(URL);
                    Regex        pattern0 = new Regex(@"\(.*\)");
                    //Regex p = new Regex("Saison ([0-9]+)");
                    Regex  t    = new Regex("- Saison [0-9]+");
                    string info = doc.DocumentNode.SelectSingleNode("//h1[@id='s-title']").InnerText.Trim();
                    info = pattern0.Replace(info, "").Trim();
                    //string season = p.Match(info).Groups[1].Value;
                    string title = t.Replace(info, "").Trim();
                    TV     tv    = Information.getTMDB_TV(Information.getTMDBId_TV(title), "fr-FR");
                    if (tv == null)
                    {
                        continue;
                    }
                    if (!Information.DataExist_db(tv.id.ToString(), table_db))
                    {
                        Information.insertTV(tv, table_db);
                        if (dataGrid.InvokeRequired)
                        {
                            dataGrid.Invoke(new Action(() => dataGrid.Rows.Add(tv.name, "INSERTED")));
                        }
                    }
                    else
                    {
                        if (UpdateCheck.Checked)
                        {
                            if (dataGrid.InvokeRequired)
                            {
                                dataGrid.Invoke(new Action(() => dataGrid.Rows.Add(tv.name, "UPDATED")));
                            }
                        }
                        else
                        if (dataGrid.InvokeRequired)
                        {
                            dataGrid.Invoke(new Action(() => dataGrid.Rows.Add(tv.name, "SEARCHING NEW EPs")));
                        }
                    }

                    preview.ImageLocation = "https://image.tmdb.org/t/p/w300_and_h450_bestv2" + tv.poster_path;


                    string seasonsURL = "https://french-serie.co" + doc.DocumentNode.SelectSingleNode(".//div[@class='fmeta icon-l']")
                                        .SelectSingleNode(".//strong").ParentNode.ParentNode.Attributes["href"].Value;
                    seasonsURL = Uri.EscapeUriString(seasonsURL);
                    //-- get seasons episodes <Season,<Episode,Streams>>
                    Dictionary <int, Dictionary <int, List <string> > > tvData = getTVData(seasonsURL);
                    // ---- save into db ------
                    Information.dumpSeasonsEpisodes_db(tv, tvData, seasons_db, stream_db, "fr-FR", UpdateCheck);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
        }