public void GetFetchRecomended() { if (!Settings.Top100Enabled) { return; } if (!Fething) { Fething = true; TempThread tempThred = mainCore.CreateThread(21); mainCore.StartThread("GetFetchRecomended", () => { try { var f = FetchRecomended(bookmarkPosters.Select(t => t.id).ToList()); if (!mainCore.GetThredActive(tempThred)) { return; } ; // COPY UPDATE PROGRESS iMDbTopList.AddRange(f); LoadMoreImages(); } finally { Fething = false; mainCore.JoinThred(tempThred); } }); } }
public override object StoreData(string year, TempThread tempThred, MALData malData) { try { string search = ActiveMovie.title.name; string data = $"action=ajaxsearchlite_search&aslp={search}&asid=1&options=qtranslate_lang%3D0%26set_intitle%3DNone%26customset%255B%255D%3Danime"; string d = core.PostRequest("https://4anime.to/wp-admin/admin-ajax.php", "https://4anime.to/", data); var doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(d); var items = doc.QuerySelectorAll("div.info"); List <FourAnimeQuickSearchItem> searchItems = new List <FourAnimeQuickSearchItem>(); foreach (var item in items) { try { var link = item.QuerySelector("> a"); var localYear = item.QuerySelectorAll("> div > span > span > a")[1]; searchItems.Add(new FourAnimeQuickSearchItem() { href = link.GetAttributeValue("href", ""), title = link.InnerHtml, year = localYear.InnerText, }); } catch (Exception _ex) { error("Error EX parsing item in 4Anime: " + _ex); } } return(searchItems); } catch (Exception _ex) { error("Fatal EX in 4Anime: " + _ex); return(new List <FourAnimeQuickSearchItem>()); } }
public override object StoreData(string year, TempThread tempThred, MALData malData) { try { string d = core.PostRequest("https://genoanime.com/data/searchdata.php", "https://genoanime.com/search", $"anime={malData.engName}"); if (!d.IsClean()) { return(null); } var doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(d); var mtxt = doc.QuerySelectorAll("div.product__item__text > h5"); GenoanimeSearchItem[] items = new GenoanimeSearchItem[mtxt.Count]; for (int i = 0; i < mtxt.Count; i++) { var stxt = mtxt[i]; var txt = stxt.QuerySelectorAll("> a")[0]; items[i] = new GenoanimeSearchItem() { name = txt.InnerText, link = txt.GetAttributeValue("href", ""), }; } return(items.Length > 0 ? items : null); } catch (Exception _ex) { error(_ex); return(null); } }
public List <RealShiroItem> StoreData(TempThread tempThred, string search) { try { if (Token == "") { loadingToken.Add(_name, true); tokens[_name] = GetShiroToken(); } if (Token == "") { error("NO SHIRO TOKEN! AT " + nameof(StoreData) + "|" + _name); return(null); } string shiroToken = GetShiroToken(); string d = DownloadString($"https://ani.api-web.site/advanced?search={search}&type={(_isMovieProvider ? "movie" : "tv")}&token={shiroToken}"); var data = JsonConvert.DeserializeObject <ShiroRoot>(d); var ret = data.Data.Nav.Nav[0].Items.Where(t => t.type == (_isMovieProvider ? "movie" : "TV")).Select(t => new RealShiroItem() { name = (t.english ?? "").Replace(" ", "") == "" ? (t.canonicalTitle ?? t.name.Replace("DUBBED", "")) : t.english, synonyms = t.synonyms.ToArray(), isDub = t.language == "dubbed", episodes = int.Parse(t.episodeCount), slug = t.slug, year = t.year, }).ToList(); return(ret); } catch (Exception _ex) { error(_ex); return(null); } }
public void GetFetch(int start = 1) { if (!Settings.Top100Enabled) { return; } Fething = true; TempThread tempThred = mainCore.CreateThread(21); mainCore.StartThread("FethTop100", async() => { try { var f = await mainCore.FetchTop100(new List <string>() { genres[MovieTypePicker.SelectedIndex] }, start, top100: IsTop100, isAnime: Settings.Top100Anime); if (!mainCore.GetThredActive(tempThred)) { return; } ; // COPY UPDATE PROGRESS iMDbTopList.AddRange(CachedTop100[f]); LoadMoreImages(); } finally { Fething = false; mainCore.JoinThred(tempThred); } }); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { List <AnimeSimpleTitle> data = (List <AnimeSimpleTitle>)storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; foreach (var subData in data) { if (ms.MalId == subData.malId) { var ep = GetAnimeSimpleEpisodes(subData.id); if (ep.HasValue) { var _val = ep.Value; for (int i = 0; i < _val.subbedEpisodes; i++) { setData.subEpisodes.Add(_val.urls[i]); } for (int i = 0; i < _val.dubbedEpisodes; i++) { setData.dubEpisodes.Add(_val.urls[i]); } } } } return(setData); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { List <AnimeVibeData> data = (List <AnimeVibeData>)storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; foreach (var subData in data) { if (subData.title.Contains(ms.japName)) { bool isDub = subData.isDub; if (isDub && !setData.DubExists) { for (int i = 1; i <= subData.maxEp; i++) { setData.dubEpisodes.Add(subData.href + i); } } else if (!setData.SubExists) { for (int i = 1; i <= subData.maxEp; i++) { setData.subEpisodes.Add(subData.href + i); } } } } return(setData); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { List <AnimeParadiseData> data = (List <AnimeParadiseData>)storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; foreach (var subData in data) { if ((setData.DubExists && subData.isDub) || (setData.SubExists && !subData.isDub)) { continue; } if (subData.season == ms.season && (ToLowerAndReplace(ms.name, false).StartsWith(ToLowerAndReplace(subData.name, false)) || ToLowerAndReplace(ms.engName, false).StartsWith(ToLowerAndReplace(subData.name, false)))) // THIS IS BECAUSE SEASON IS SEPERATED FROM NAME { try { string d = DownloadString("https://animeparadise.cc/anime.php?s=" + subData.id, referer: subData.referer); var doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(d); var nodes = doc.QuerySelectorAll("h1.title"); int lastEp = int.Parse(nodes[^ 1].InnerText);
public override object StoreData(bool isMovie, TempThread tempThred) { if (!isMovie) { return(null); } RealShiroItem?[] items = new RealShiroItem?[2] { null, null }; bool returnNull = true; var bData = shiroBase.StoreData(tempThred, ToDown(ActiveMovie.title.name).Replace(" ", "")); foreach (var data in bData) { if (data.year != ActiveMovie.title.year.Substring(0, 4)) { continue; } if (data.synonyms.Contains(data.name) || ToDown(data.name) == ToDown(ActiveMovie.title.name) || ToDown(data.name) == ToDown(ActiveMovie.title.ogName)) { returnNull = false; items[data.isDub ? 1 : 0] = data; } } return(returnNull ? null : items); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { List <DubbedSearchItem> data = (List <DubbedSearchItem>)storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; foreach (var subData in data) { if (subData.isMovie) { continue; } // SEE https://bestdubbedanime.com/search/_ string name = subData.name.ToLower(); string baseName = ToDown(name); if (baseName.StartsWith(ToDown(ms.name)) || baseName.StartsWith(ToDown(ActiveMovie.title.name)) || baseName.StartsWith(ToDown(ActiveMovie.title.ogName))) { int season = 1; if (name.Contains("season 2") || name.Contains("2nd season") || name.Contains("second season") || (name.EndsWith(" 2") && !name.EndsWith("part 2"))) { season = 2; } else if (name.Contains("season 3") || name.Contains("3rd season") || (name.EndsWith(" 3") && !name.EndsWith("part 3"))) { season = 3; } if (ms.season != season) { continue; } int part = 1; if (name.Contains("part 2") || name.Contains("part ii")) { part = 2; } if (ms.part != part) { continue; } var ep = provider.GetDubbedAnimeEpisode(subData.slug, 1); if (!ep.HasValue) { continue; } for (int i = 0; i < ep.Value.totalEp; i++) { setData.dubEpisodes.Add(subData.slug); } break; } } return(setData); }
public override object StoreData(string year, TempThread tempThred, MALData malData) { var list = TheMovieHelper.SearchQuary(activeMovie.title.name, core); if (!GetThredActive(tempThred)) { return(null); } ; // COPY UPDATE PROGRESS return(list); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { List <RealShiroItem> data = (List <RealShiroItem>)storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; if (Token == "") { error("NO SHIRO TOKEN! AT " + nameof(GetSeasonData)); return(setData); } string[] extraData = new string[2]; foreach (var subData in data) { if ((setData.DubExists && subData.isDub) || (setData.SubExists && !subData.isDub)) { continue; } bool synoExist = false; if (subData.synonyms != null && ms.synonyms != null && ms.synonyms.Count > 0 && subData.synonyms.Length > 0) { synoExist = ms.synonyms.Where(t => subData.synonyms.Contains(t)).ToArray().Length > 0; } if (ToDown(ms.engName) == ToDown(subData.name) || synoExist) { List <string> episodes = new List <string>(); string slug = subData.slug; for (int i = 1; i <= subData.episodes; i++) { episodes.Add($"https://tapi.{shiroBase._siteUrl.Replace("https://", "")}/anime-episode/slug/{slug}-episode-{i}?token={Token}"); } if (subData.isDub) { setData.dubEpisodes = episodes; } else { setData.subEpisodes = episodes; } extraData[subData.isDub ? 1 : 0] = slug; } } setData.extraData = extraData; return(setData); }
public override object StoreData(bool isMovie, TempThread tempThred) { var search = baseProvider.Search(ActiveMovie.title.name); foreach (var s in search) { if (s.imdb_code == ActiveMovie.title.id) { return(s.id); } } return(null); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { List <string> data = (List <string>)storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; foreach (var subData in data) { } return(setData); }
public override object StoreData(string year, TempThread tempThred, MALData malData) { try { string search = malData.engName.Replace("-", " "); List <AnimeParadiseData> data = new List <AnimeParadiseData>(); string searchQry = "https://animeparadise.cc/search.php?query=" + search; string d = DownloadString(searchQry, referer: (IsNewApi ? "https://animeparadise.cc/" : "https://animeparadise.cc/index.php")); if (d == "") { return(null); } var doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(d); var nodes = doc.QuerySelectorAll("div.content > p"); foreach (var item in nodes) { var _data = item.QuerySelector("strong > a"); int.TryParse(_data.GetAttributeValue("href", "").Split('=')[1], out int id); bool isDub = item.QuerySelector("span").InnerText == "DUB"; string name = _data.InnerText; int season = 1; for (int i = 2; i < 10; i++) { if (item.InnerText.Contains($"(Season {i})")) { season = i; break; } } if (id != 0) { data.Add(new AnimeParadiseData() { isDub = isDub, name = name, id = id, season = season, referer = searchQry, }); } } return(data); } catch (Exception _ex) { error(_ex); return(null); } }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { YuSearchItems[] data = (YuSearchItems[])storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; if (baseProvider == null) { return(setData); } int index = 0; foreach (var subData in data) { string toDownTitle = ToDown(subData.fields.title); if (index < 2 || ToDown(ms.name) == toDownTitle || ToDown(ms.engName) == toDownTitle || ToDown(ms.japName) == toDownTitle) // CAN BE REMOVED, BUT MIGHT BE BLOCKED DUE TO MANY REQUESTS { var info = baseProvider.GetYuInfo(subData.pk, subData.fields.slug); if (!GetThredActive(tempThread)) { return(setData); } if (info.HasValue) { var infoVal = info.Value; if (infoVal.malId == ms.MalId) { for (int i = 0; i < infoVal.subbedEps; i++) { setData.subEpisodes.Add($"https://yugenani.me/watch/{subData.pk}/{subData.fields.slug}/{(i + 1)}/"); } for (int i = 0; i < infoVal.dubbedEps; i++) { setData.dubEpisodes.Add($"https://yugenani.me/watch/{subData.pk}/{subData.fields.slug}-dub/{(i + 1)}/"); } return(setData); } } } index++; } return(setData); }
public void GetFetch(int start = 1) { if (!Settings.Top100Enabled) { return; } Fething = true; TempThread tempThred = mainCore.CreateThread(21); mainCore.StartThread("FethTop100", () => { try { var f = FetchTop100(new List <string>() { genres[MovieTypePicker.SelectedIndex] }, start, top100: IsTop100, isAnime: Settings.Top100Anime); if (!mainCore.GetThredActive(tempThred)) { return; } ; // COPY UPDATE PROGRESS iMDbTopList.AddRange(f); /* Device.BeginInvokeOnMainThread(() => { * * for (int i = 0; i < iMDbTopList.Count; i++) { * * string img = ConvertIMDbImagesToHD(iMDbTopList[i].img, 67, 98, 4); * IMDbTopList x = iMDbTopList[i]; * * AddEpisode(new EpisodeResult() { Description = x.descript, Title = x.name + " | ★ " + x.rating.Replace(",", "."), Id = x.place, PosterUrl = img, extraInfo = "Id="+x.id+"|||Name="+x.name+"|||" }, false); * } * * // LoadMoreImages(false); * // LoadMoreImages(); * * });*/ //if (!GetThredActive(tempThred)) { return; }; // COPY UPDATE PROGRESS LoadMoreImages(); } finally { Fething = false; mainCore.JoinThred(tempThred); } }); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { AnimeFeverHelper.AnimeFeverSearchInfo data = (AnimeFeverHelper.AnimeFeverSearchInfo)storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; foreach (var subData in data.data) { if (subData.name == ms.engName || subData.alt_name == ms.engName) { try { var mainInfo = helper.GetAnimeFeverEpisodeInfo(subData.id, subData.slug); if (mainInfo == null) { continue; } var _mainInfo = mainInfo.Value; var emtyList = new string[_mainInfo.data.Count].ToList(); var referers = new string[_mainInfo.data.Count]; int index = 0; setData.dubEpisodes = emtyList; setData.subEpisodes = emtyList; foreach (var epInfo in _mainInfo.data) { var langs = epInfo.video_meta.audio_languages; if (langs.Contains("eng")) { setData.dubEpisodes[index] = (epInfo.id.ToString()); } if (langs.Contains("jap")) { setData.subEpisodes[index] = (epInfo.id.ToString()); } referers[index] = $"https://www.animefever.tv/series/{subData.id}-{subData.slug}/episode/{epInfo.id}-episode-{index+1}-{epInfo.slug}"; print("ANIMEFEVER REFERER: " + referers[index]); index++; } setData.extraData = referers; } catch (Exception) { } } } return(setData); }
//public override bool HasAnimeMovie => false; public override object StoreData(bool isMovie, TempThread tempThred) { try { var list = TheMovieHelper.SearchQuary(activeMovie.title.name, core); if (!GetThredActive(tempThred)) { return(null); } ; // COPY UPDATE PROGRESS MovieType mType = activeMovie.title.movieType; string compare = ToDown(activeMovie.title.name, true, ""); var watchMovieSeasonsData = new Dictionary <int, string>(); if (mType.IsMovie()) { //string mustContain = mType == MovieType.AnimeMovie ? "/anime-info/" : "/series/"; string mustContain = isMovie ? "/movie/" : "/series/"; TheMovieHelper.TheMovieTitle[] matching = list.Where(t => ToDown(t.name, true, "") == compare && t.season == -1 && t.href.Contains(mustContain)).ToArray(); if (matching.Length > 0) { TheMovieHelper.TheMovieTitle title = matching[0]; print("LOADED:::::::::-->>>1 " + title.href); string d = DownloadString(title.href); int maxEp = TheMovieHelper.GetMaxEp(d, title.href); if (maxEp == 0 || maxEp == 1) { string rEp = title.href + "/" + (maxEp - 1); //+ "-episode-" + maxEp; watchMovieSeasonsData[-1] = rEp; print("LOADED:::::::::-->>>2 " + rEp); } } } else { var episodes = list.Where(t => !t.isDub && t.season != -1 && ToDown(t.name, true, "") == compare && t.href.Contains("/series/")).ToList().OrderBy(t => t.season).ToArray(); for (int i = 0; i < episodes.Length; i++) { watchMovieSeasonsData[episodes[i].season] = episodes[i].href; } } return(watchMovieSeasonsData); } catch { return(null); } }
public override object StoreData(string year, TempThread tempThred, MALData malData) { if (baseProvider == null) { return(null); } var res = baseProvider.SearchSite(malData.engName); if (res.HasValue) { return(res.Value.query); } else { return(null); } }
public override object StoreData(string year, TempThread tempThred, MALData malData) { try { string d = DownloadString("https://t-arrayapi.vercel.app/api/search/overlord/1", tempThred, referer: "https://www.arrayanime.com/"); if (d.IsClean()) { ArrayAnimeSearchResultRoot searchResultsRoot = JsonConvert.DeserializeObject <ArrayAnimeSearchResultRoot>(d); if (searchResultsRoot.results != null && searchResultsRoot.results.Length > 0) { return(searchResultsRoot.results); } } } catch (System.Exception _ex) { error(_ex); } return(null); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { if (storedData == null) { return(new NonBloatSeasonData()); } List <NineAnimeDataSearch> data = (List <NineAnimeDataSearch>)storedData; if (data.Count == 0) { return(new NonBloatSeasonData()); } print("START:::: " + data.FString()); NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; foreach (var subData in data) { if (subData.names.Split(' ').Contains(ms.japName)) { bool isDub = subData.isDub; if (isDub && !setData.dubExists) { for (int i = 1; i <= subData.maxEp; i++) { setData.dubEpisodes.Add(subData.href); } } else if (!setData.subExists) { for (int i = 1; i <= subData.maxEp; i++) { setData.subEpisodes.Add(subData.href); } } } } return(setData); }
public override NonBloatSeasonData GetSeasonData(MALSeason ms, TempThread tempThread, string year, object storedData) { GenoanimeSearchItem[] data = (GenoanimeSearchItem[])storedData; NonBloatSeasonData setData = new NonBloatSeasonData() { dubEpisodes = new List <string>(), subEpisodes = new List <string>() }; string cName = ToDown(ms.engName); string[] cSyno = ms.synonyms.Select(t => ToDown(t)).ToArray(); foreach (var subData in data) { bool isDub = subData.name.Contains(" (Dub)"); string name = subData.name.Replace(" (Dub)", ""); string dName = ToDown(name); if (dName == cName || cSyno.Contains(dName)) { if ((!setData.DubExists && isDub) || (!setData.SubExists && !isDub)) { string d = DownloadString("https://genoanime.com" + subData.link[1..]);
public override void FishMainLink(string year, TempThread tempThred, MALData malData) { print("FF:::: <>>"); print("NDNDNDNND;;; " + Name + "|" + year + "|" + malData.engName); object storedData = NullMetadata ? null : StoreData(year, tempThred, malData); if (storedData == null && !NullMetadata) { return; } for (int i = 0; i < ActiveMovie.title.MALData.seasonData.Count; i++) { for (int q = 0; q < ActiveMovie.title.MALData.seasonData[i].seasons.Count; q++) { try { MALSeason ms; lock (_lock) { ms = ActiveMovie.title.MALData.seasonData[i].seasons[q]; ms.season = i; ms.part = q + 1; } NonBloatSeasonData data = GetSeasonData(ms, tempThred, year, storedData); data.name = Name; lock (_lock) { ms = ActiveMovie.title.MALData.seasonData[i].seasons[q]; if (ms.nonBloatSeasonData == null) { ms.nonBloatSeasonData = new List <NonBloatSeasonData>(); } ms.nonBloatSeasonData.Add(data); ActiveMovie.title.MALData.seasonData[i].seasons[q] = ms; } } catch (Exception _ex) { print("FATAL EX IN Fish " + Name + " | " + _ex); } } } }
public static void CheckGitHubUpdate() { try { if (Device.RuntimePlatform == Device.Android) // ONLY ANDROID CAN UPDATE { TempThread tempThred = mainCore.CreateThread(4); mainCore.StartThread("GitHub Update Thread", async() => { try { string d = mainCore.DownloadString("https://github.com/LagradOst/CloudStream-2/releases", tempThred); if (!mainCore.GetThredActive(tempThred)) { return; } ; // COPY UPDATE PROGRESS string look = "/LagradOst/CloudStream-2/releases/tag/"; // float bigf = -1; // string bigUpdTxt = ""; // while (d.Contains(look)) { githubUpdateTag = FindHTML(d, look, "\""); githubUpdateText = FindHTML(d, look + githubUpdateTag + "\">", "<"); if (Settings.ShowAppUpdate && NewGithubUpdate) { await ShowUpdate(); } print("UPDATE SEARCHED: " + githubUpdateTag + "|" + githubUpdateText); } finally { mainCore.JoinThred(tempThred); } }); } } catch (Exception _ex) { print("Github ex::" + _ex); } }
public override void FishMainLinkTSync(TempThread tempThread) { if (!TypeCheck()) { return; } object storedData = NullMetadata ? null : StoreData(ActiveMovie.title.IsMovie, tempThread); if (storedData == null && !NullMetadata) { return; } lock (metadataLock) { if (ActiveMovie.title.movieMetadata == null) { core.activeMovie.title.movieMetadata = new List <MovieMetadata>(); } core.activeMovie.title.movieMetadata.Add(new MovieMetadata() { name = Name, metadata = storedData }); } }
public void LoadLink(string episodeLink, int normalEpisode, TempThread tempThred, bool isDub, string slug) { try { string episodeReq = DownloadString(episodeLink, referer: $"{_siteUrl}/stream/{slug}"); var epData = JsonConvert.DeserializeObject <ShiroEpisodeRoot>(episodeReq); foreach (var video in epData.Data.videos) { string[] before = video.host switch { "googledrive" => new string[] { "https://ani.googledrive.stream/vidstreaming/vid-ad/" }, "vidstream" => new string[] { "https://gogo-stream.com/ajax.php?id=", "https://ani.googledrive.stream/vidstreaming/vid/" }, //"https://gogo-stream.com/streaming.php?id=", // https://ani.googledrive.stream/vidstreaming/vid/ _ => null, }; if (before == null) { continue; } foreach (var b in before) { string _before = b + video.video_id; string _d = DownloadString(_before).Replace("\\", ""); if (!core.GetThredActive(tempThred)) { return; } var links = GetAllFilesRegex(_d); foreach (var link in links) { AddPotentialLink(normalEpisode, link.url, $"{_name}{(video.host == "googledrive" ? " GoogleDrive" : "")}{(_isMovieProvider ? (isDub ? " (Dub)" : " (Sub)") : "")}", 15, link.label); } } } } catch (Exception _ex) { error(_ex); } }
static void Main(string[] args) { //Tworzenie listy obiektów klasy Zawodnik lOPlayersList = new List <CPlayerModel>(); //Wypełnianie list obiektami z argumentem całej listy w celu komunikacji mędziy zawodnikami for (int i = 0; i < 10; i++) { lOPlayersList.Add(new CPlayerModel(i, lOPlayersList)); } //Tworzenie obiektu klasy Boisko CCourt OCourt = new CCourt(lOPlayersList); Class1 View = new Class1(lOPlayersList); //Tworzenie listy wątków List <Thread> lThreadList = new List <Thread>(); //Generowanie listy wątków (dla każdego obiektu zawodnik osobny wątek) foreach (CPlayerModel TempPlayer in lOPlayersList) { lThreadList.Add(new Thread(TempPlayer.Decision)); } //Dodanie do listy wątków wątku dla obiektu klasy boisko lThreadList.Add(new Thread(OCourt.Run)); lThreadList.Add(new Thread(View.View)); //Uruchomienie wszystkich wątków foreach (Thread TempThread in lThreadList) { TempThread.Start(); } //Czekanie na zakńczenie pracy wszystkich wątków foreach (Thread TempThread in lThreadList) { TempThread.Join(); } }
public override void FishMainLink(string year, TempThread tempThred, MALData malData) { object storedData = StoreData(year, tempThred, malData); if (storedData == null) { return; } for (int i = 0; i < activeMovie.title.MALData.seasonData.Count; i++) { for (int q = 0; q < activeMovie.title.MALData.seasonData[i].seasons.Count; q++) { try { MALSeason ms; lock (_lock) { ms = activeMovie.title.MALData.seasonData[i].seasons[q]; } NonBloatSeasonData data = GetSeasonData(ms, tempThred, year, storedData); data.name = Name; lock (_lock) { ms = activeMovie.title.MALData.seasonData[i].seasons[q]; if (ms.nonBloatSeasonData == null) { ms.nonBloatSeasonData = new List <NonBloatSeasonData>(); } ms.nonBloatSeasonData.Add(data); activeMovie.title.MALData.seasonData[i].seasons[q] = ms; } } catch (Exception _ex) { print("FATAL EX IN Fish " + Name + " | " + _ex); } } } }
public override void LoadLink(string episodeLink, int episode, int normalEpisode, TempThread tempThred, object extraData, bool isDub) { try { string d = ""; #pragma warning disable if (!IsNewApi) { string main = DownloadString(episodeLink); if (main == "") { return; } string fileId = FindHTML(main, "fileId=", "\""); if (fileId == "") { return; } d = DownloadString($"https://stream.animeparadise.cc/sources?fileId={fileId}", referer: $"https://stream.animeparadise.cc/embed.html?fileId={fileId}"); } else { d = DownloadString(episodeLink); } #pragma warning restore if (d == "") { return; } var videos = JsonConvert.DeserializeObject <AnimeParadiseVideoFile[]>(d); int prio = 10; foreach (var video in videos) { AddPotentialLink(normalEpisode, video.file, "AnimeParadise", prio, video.label); prio--; } } catch (Exception _ex) { error(_ex); } }