Esempio n. 1
0
        public static async Task<JsonListMangas> GetMangaSearch(string server, string keyWord, bool isStart = true)
        {
            string url = Config.ProcessingKeyWord(server, isStart, keyWord);
            string html = await Utils.HttpClientRequert(url, null);

            string json = "";
            if (server.Contains("truyentranh8"))
            {
                json = await GetData.GetMangaTruyenTranh8(html);
            }
            else if (server.Contains("truyentranhtuan.com"))
            {
                json = await GetData.GetMangaTTT(html, keyWord);
            }
            else if (server.Contains("manga24h"))
            {
                json = await GetData.GetSearch24H(html, keyWord);
            }
            else if (server.Contains("comicvn.net"))
            {
                json = await GetData.GetMangaComicVN(html);
            }
            else if (server.Contains("vuitruyentranh.vn"))
            {
                json = await GetData.GetMangaVTT(html);
            }
            else if (server.Contains("izmanga.com"))
            {
                json = await GetData.GetSearchIZManga(html);
            }
            else if (server.Contains("hamtruyen.vn"))
            {
                json = await GetData.GetMangaHamTruyen(html);
            }
            else if (server.Contains("blogtruyen.com"))
            {

                json = await GetData.GetSearchBlogTruyen(html);
            }
            else if (url.Contains("fphimsex.com"))
            {
                json = await GetData.GetMangaFPhimSex(html);
            }
            JsonListMangas result = new JsonListMangas();
            result = Utils.JsonDeserialize<JsonListMangas>(json);
            return result;
        }
Esempio n. 2
0
        internal async Task SearchManga(string keyWord, bool isStart = true)
        {
            base.SetProgressIndicator("SearchManga", true, "Seaching \"" + keyWord + "\"");
            if (isStart)
            {
                this.Mangas.Clear();
            }
            JsonListMangas jsonListMangas = new JsonListMangas();
            jsonListMangas = await Config.GetMangaSearch(MangaCore.Comon.ListSever.FirstOrDefault(t => t.Key == App.Oldsever).Value, keyWord, isStart);
            if (jsonListMangas.error_code == 0)
            {
              
                if (this.Mangas.Count >0)
                {
                    if (jsonListMangas.data[jsonListMangas.data.Count - 1].NameManga == this.Mangas[this.Mangas.Count - 1].NameManga)
                    {
                        base.SetProgressIndicator("SearchManga", false, "Seach...");
                        return;
                    }
                    
                }
                foreach (var item in jsonListMangas.data)
                {
                    if (!App._18_cong && item.NameManga.Contains("18"))
                    {
                        continue;
                    }
                    this.Mangas.Add(new Manga(item.UriManga, item.NameManga, item.Cover, item.NameChaper, App.NewSever, "", 0));
                }

            }
            else
            {
              //  Utils.ShowMessage("Error: " + jsonListMangas.msg, "Error", 0);
            }
            if (this.Mangas.Count > 0)
            {
                this.IsLoadManga = LoadState.None;
            }
            else
            {
                this.IsLoadManga = LoadState.None;
            }
            base.SetProgressIndicator("SearchManga", false, "Seach...");
        }
Esempio n. 3
0
 public static async Task<JsonListMangas> GetManga(string url, bool isStart = true)
 {
     url = Config.ProcessingUrl(url, isStart);
     string html;
     html = await Utils.HttpClientRequert(url, null);
     string json = "";
     if (url.Contains("truyentranh8"))
     {
         json = await GetData.GetMangaTruyenTranh8(html);
     }
     else if (url.Contains("truyentranhtuan.com"))
     {
         json = await GetData.GetMangaTTT(html);
     }
     else if (url.Contains("manga24h.com"))
     {
         json = await GetData.GetManga24H(html);
     }
     else if (url.Contains("comicvn.net"))
     {
         if (string.IsNullOrEmpty(hash))
         {
             string htmlHash = await Utils.HttpClientRequert("http://comicvn.net/");
             hash = GetHash(htmlHash);
         }
        //End lấy Hash search
         json = await GetData.GetMangaComicVN(html);
     }
     else if (url.Contains("vuitruyentranh.vn"))
     {
         json = await GetData.GetMangaVTT(html);
     }
     else if (url.Contains("izmanga.com"))
     {
         json = await GetData.GetMangaIZManga(html);
     }
     else if (url.Contains("hamtruyen.vn"))
     {
         json = await GetData.GetMangaHamTruyen(html);
     }
     else if (url.Contains("blogtruyen.com"))
     {
         json = await GetData.GetMangaBlogTruyen(html);
     }
     else if (url.Contains("fphimsex.com"))
     {
         json = await GetData.GetMangaFPhimSex(html);
     }
     JsonListMangas result = new JsonListMangas();
     result = Utils.JsonDeserialize<JsonListMangas>(json);
     return result;
 }
Esempio n. 4
0
        internal async Task LoadManga(bool isStart = true, string url = "")
        {
            base.SetProgressIndicator("LoadManga", true, "Loading...");
            JsonListMangas jsonListMangas = new JsonListMangas();
            DateTime date = DateTime.Now;
            System.Globalization.CultureInfo CI = new System.Globalization.CultureInfo("vi-VN");
            DateTime dateHistory = DateTime.Parse("30/10/15", (IFormatProvider)CI);
            int x = (DateTime.Now - dateHistory).Days;
            var ver = Utils.GetVersionApp();
            // CheckPublic true and new ver return jsonData
            if (App.CheckPublic.Value && ver == "1.0.0.4" && x < 7)
            {
                string json = await Utils.ReadTextFileFromProject("dataMangas.json");
                jsonListMangas = MangaCore.Utils.JsonDeserialize<JsonListMangas>(json);
                foreach (var item in jsonListMangas.data)
                {
                    this.Mangas.Add(new Manga(item.UriManga, item.NameManga, item.Cover, item.NameChaper, App.NewSever, "", 0));
                }
            }
            else
            {
                if (this.IsLoadManga == LoadState.None || !isStart)
                {
                    this.IsLoadManga = LoadState.Loading;

                    if (string.IsNullOrEmpty(url) || url == MangaCore.Comon.ListSever.FirstOrDefault(t => t.Key == App.Oldsever).Value)
                    {
                        if (isStart)
                        {
                            this.Mangas.Clear();
                        }
                        url = MangaCore.Comon.ListSever.FirstOrDefault(t => t.Key == App.Oldsever).Value;
                        jsonListMangas = await Config.GetManga(url, isStart);
                    }
                    else
                    {
                        if (isStart)
                        {
                            this.Mangas.Clear();
                        }
                        jsonListMangas = await Config.GetManga(url, isStart);
                    }
                    App.UrlMenu = url;
                    if (jsonListMangas.error_code == 0)
                    {
                        if (this.Mangas.Count > 0)
                        {
                            if (jsonListMangas.data[jsonListMangas.data.Count - 1].NameManga == this.Mangas[this.Mangas.Count - 1].NameManga)
                            {
                                base.SetProgressIndicator("LoadManga", false, "");
                                return;
                            }

                        }
                        foreach (var item in jsonListMangas.data)
                        {
                            if (!App._18_cong && item.NameManga.Contains("18"))
                            {
                                continue;
                            }
                            this.Mangas.Add(new Manga(item.UriManga, item.NameManga, item.Cover, item.NameChaper, App.NewSever, "", 0));
                        }
                    }
                    else
                    {
                        // Utils.ShowMessage("Error: " + jsonListMangas.msg, "Error", 0);
                    }
                    if (this.Mangas.Count > 0)
                    {
                        this.IsLoadManga = LoadState.None;
                    }
                    else
                    {
                        this.IsLoadManga = LoadState.None;
                    }
                }
            }
            
            base.SetProgressIndicator("LoadManga", false, "Loading...");
        }