public static Task getAnimes(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) { int PageCount = 45; Total.Invoke(new Action(() => Total.Text = PageCount.ToString())); try { for (int i = 1; i < PageCount; i++) { List <string> AnimeList = getAnimeList(url + $"?page={i}"); List <Anime> animes = getAnimesPerPage(dataGrid, preview, AnimeList); Scraped.Invoke(new Action(() => Scraped.Text = (i).ToString())); } } catch { } finally { 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); }
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); }
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); }