Пример #1
0
        public override List <String[]> get_pages_details(String link, String path, String chap)
        {
            String[] content = HtmlRequest.get_html(link);

            List <String[]> ret_pages = new List <string[]>();

            double nb_pages = 0;

            foreach (String i in content)
            {
                if (i.IndexOf("<option value=") != -1)
                {
                    nb_pages += 1;
                }
            }

            int cpt_page = 1;

            while (cpt_page <= nb_pages)
            {
                String page = cpt_page.ToString();
                if (cpt_page < 10)
                {
                    page = "0" + cpt_page.ToString();
                }


                ret_pages.Add(new String[4] {
                    ((int)((cpt_page / nb_pages) * 100.0)).ToString(), link + cpt_page.ToString() + ".html", cpt_page.ToString(), chap
                });
                cpt_page += 1;
            }

            return(ret_pages);
        }
Пример #2
0
        public override void download_one_scan(String link, String nb_page, String chapter, String path)
        {
            String[] content = HtmlRequest.get_html(link);

            foreach (String i in content)
            {
                if (i.IndexOf("class=\"img-responsive-2\" style=\"cursor: pointer !important;\"") != -1)
                {
                    String link_img  = HtmlRequest.cut_str(i, "src=\"", "\" class");
                    int    pos_point = link_img.LastIndexOf('.');
                    String ext       = link_img.Substring(pos_point);

                    String nb_chapter = chapter.ToString();
                    if (float.Parse(chapter, CultureInfo.InvariantCulture.NumberFormat) < 10)
                    {
                        nb_chapter = "0" + nb_chapter;
                    }

                    if (Int32.Parse(nb_page) < 10)
                    {
                        nb_page = "0" + nb_page;
                    }

                    HtmlRequest.save_image(link_img, path + "chap " + nb_chapter + " page " + nb_page + ext);
                }
            }
        }
Пример #3
0
        public override void download_one_scan(String link, String nb_page, String chapter, String path)
        {
            String[] content = HtmlRequest.get_html(link);

            foreach (String i in content)
            {
                if (i.IndexOf("<img data-img=") != -1)
                {
                    String link_img  = HtmlRequest.cut_str(i, "src=\"", "\"/>");
                    int    pos_point = link_img.LastIndexOf('.');
                    String ext       = link_img.Substring(pos_point);

                    String nb_chapter = "";
                    if (float.Parse(chapter, CultureInfo.InvariantCulture.NumberFormat) < 10)
                    {
                        nb_chapter = "0" + chapter.ToString();
                    }

                    if (Int32.Parse(nb_page) < 10)
                    {
                        nb_page = "0" + nb_page;
                    }

                    if (chapter != "")
                    {
                        HtmlRequest.save_image(link_img, path + "chap " + nb_chapter + " page " + nb_page + ext);
                    }
                    else
                    {
                        HtmlRequest.save_image(link_img, path + "page " + nb_page + ext);
                    }
                }
            }
        }
Пример #4
0
        public override void download_one_scan(String link, String nb_page, String chapter, String path)
        {
            String[] content = HtmlRequest.get_html(link);

            foreach (String i in content)
            {
                if (i.IndexOf("onerror=\"javascript:rerender(this);\"") != -1)
                {
                    String link_img = HtmlRequest.cut_str(i, "<img src=\"", "\" onerror");
                    int    pos      = link_img.LastIndexOf(".");
                    int    pos2     = link_img.LastIndexOf("?");
                    String ext      = link_img.Substring(pos, pos2 - pos);

                    String nb_chapter = chapter.ToString();
                    if (float.Parse(chapter, CultureInfo.InvariantCulture.NumberFormat) < 10)
                    {
                        nb_chapter = "0" + nb_chapter;
                    }

                    if (Int32.Parse(nb_page) < 10)
                    {
                        nb_page = "0" + nb_page;
                    }

                    if (link.IndexOf("javascript") == -1)
                    {
                        HtmlRequest.save_image(link_img, path + "chap " + nb_chapter + " page " + nb_page + ext);
                    }

                    return;
                }
            }
        }
Пример #5
0
        public override void load_all_mangas()
        {
            allManga = new List <KeyValuePair <String, String> >();

            String[] content = HtmlRequest.get_html(link_list_manga);

            if (content == null)
            {
                allManga = null;
                return;
            }

            foreach (String i in content)
            {
                String[] stringSeparators = new String[] { "</li><li>" };
                if (i.IndexOf("<li><a class=\"manga_info\" rel=\"") != -1)
                {
                    String[] manga;
                    manga = i.Split(stringSeparators, StringSplitOptions.None);
                    foreach (String m in manga)
                    {
                        String name = HtmlRequest.cut_str(m, "rel=\"", "\" href=").Replace("&quot;", "-").Replace("&amp;", "&");
                        String link = HtmlRequest.cut_str(m, "\" href=\"", "\"><span>");
                        allManga.Add(new KeyValuePair <String, String>(name, link));
                    }
                }
            }
        }
Пример #6
0
        private void load_page_manga(String link)
        {
            String[] content = HtmlRequest.get_html(link);

            foreach (String i in content)
            {
                if (i.IndexOf("<span class=\"manga-item\">") != -1)
                {
                    String str    = i.Trim();
                    String n_link = HtmlRequest.cut_str(str, "<a href=\"", "\">");
                    String name   = HtmlRequest.cut_str(str, n_link + "\">", "</a>");
                    allManga.Add(new KeyValuePair <String, String>(name, n_link));
                }
            }
        }
Пример #7
0
        public override void load_chapters(KeyValuePair <String, String> infos)
        {
            String[] html = HtmlRequest.get_html(infos.Value);

            List <String[]> array_positions = new List <string[]>();

            list_chapter.Clear();
            int is_start = 0;

            name = infos.Key;
            link = infos.Value;

            String[] tab;

            String n_link = "";
            String desc   = "";

            foreach (String i in html)
            {
                String str = i.Trim();

                if (str.IndexOf("<ul class=\"chp_lst\">") != -1)
                {
                    is_start = 1;
                }

                if (is_start == 1 && str.IndexOf("<a href=\"") != -1)
                {
                    n_link = HtmlRequest.cut_str(str, "<a href=\"", "\">");
                }

                if (is_start == 1 && str.IndexOf("<span class=\"val\">") != -1)
                {
                    desc = HtmlRequest.cut_str(str, "\"></span>", " </span>");

                    tab = new String[3];

                    tab[0] = "1";
                    tab[1] = String.Copy(n_link);
                    tab[2] = String.Copy(desc);

                    list_chapter.Add(tab);
                }
            }
            nb_tomes = 0;
        }
Пример #8
0
        public override void load_chapters(KeyValuePair <String, String> infos)
        {
            String[] html = HtmlRequest.get_html(infos.Value);

            List <String[]> array_positions = new List <string[]>();
            int             found;

            name = infos.Key;
            link = infos.Value;

            list_chapter.Clear();
            int is_start = 0;

            String[] tab;

            foreach (String i in html)
            {
                found = i.IndexOf("<a href=\"/");


                if (i.IndexOf("<th class=\"leftgap\">Chapter Name</th>") != -1)
                {
                    is_start = 1;
                }

                if (found == 0 && is_start == 1)
                {
                    int end_pos = i.IndexOf("/\">");

                    String link = HtmlRequest.cut_str(i, "<a href=\"", "\">");
                    String desc = HtmlRequest.cut_str(i, "\">", "</a>") + " : " + HtmlRequest.cut_str(i, "</a> : ", "</td>");

                    tab = new String[3];

                    tab[0] = "1";
                    tab[1] = link;
                    tab[2] = desc;

                    list_chapter.Add(tab);
                }
            }
            nb_tomes = 0;
        }
Пример #9
0
        public override void load_all_mangas()
        {
            allManga = new List <KeyValuePair <String, String> >();

            String[] content  = HtmlRequest.get_html(link_list_manga);
            int      is_start = 0;

            if (content == null)
            {
                allManga = null;
                return;
            }

            foreach (String i in content)
            {
                if (i.IndexOf("<div class=\"series_col\"><a name=\" \"></a>") != -1)
                {
                    is_start = 1;
                }

                if (i.IndexOf("<li><b>Network</b></li>") != -1)
                {
                    is_start = 0;
                }

                if (i.IndexOf("<li><a href=\"/") != -1 && is_start == 1)
                {
                    String str;
                    if (i.IndexOf("<ul class=\"series_alpha\">") != -1)
                    {
                        str = i.Substring(25);
                    }
                    else
                    {
                        str = i;
                    }

                    String name = HtmlRequest.cut_str(str, "\">", "</a>");
                    String link = HtmlRequest.cut_str(str, "<li><a href=\"", "\">");
                    allManga.Add(new KeyValuePair <String, String>(name, "http://www.mangareader.net" + link));
                }
            }
        }
Пример #10
0
        public override List <String[]> get_pages_details(String link, String path, String chap)
        {
            String[] content = HtmlRequest.get_html("http://www.mangareader.net" + link);

            List <String[]> ret_pages = new List <string[]>();

            double nb_pages = 0;
            int    is_start = 0;

            foreach (String i in content)
            {
                if (i.IndexOf("<div id=\"selectpage\">") != -1)
                {
                    is_start = 1;
                }
                if (i.IndexOf("<option value=") != -1 && is_start == 1)
                {
                    nb_pages += 1;
                }
            }

            int cpt_page = 1;

            while (cpt_page <= nb_pages)
            {
                String page = cpt_page.ToString();
                if (cpt_page < 10)
                {
                    page = "0" + cpt_page.ToString();
                }


                ret_pages.Add(new String[4] {
                    ((int)((cpt_page / nb_pages) * 100.0)).ToString(), "http://www.mangareader.net" + link + "/" + cpt_page.ToString(), cpt_page.ToString(), chap
                });
                cpt_page += 1;
            }

            return(ret_pages);
        }
Пример #11
0
        public override void load_all_mangas()
        {
            allManga = new List <KeyValuePair <String, String> >();

            String[] content = HtmlRequest.get_html(link_list_manga);

            if (content == null)
            {
                allManga = null;
                return;
            }

            foreach (String i in content)
            {
                if (i.IndexOf("<div class=\"cell\"><a href=\"/mangas/") != -1 && i.IndexOf("blackout") == -1)
                {
                    String name = HtmlRequest.cut_str(i, "/\">", "</a></div>");
                    String link = HtmlRequest.cut_str(i, "<a href=\"", "/\">");
                    allManga.Add(new KeyValuePair <String, String>(name, "http://www.japscan.com" + link + "/"));
                }
            }
        }
Пример #12
0
        public override void load_chapters(KeyValuePair <String, String> infos)
        {
            String[] html = HtmlRequest.get_html(infos.Value);

            List <String[]> array_positions = new List <string[]>();
            int             found;
            int             found2;

            name = infos.Key;
            link = infos.Value;

            list_chapter.Clear();

            foreach (String i in html)
            {
                found  = i.IndexOf("<a href=\"//www.japscan.com/lecture-en-ligne/");
                found2 = i.IndexOf("<h2>Volume");

                if (found == 0)
                {
                    int end_pos = i.IndexOf("/\">");

                    String link = i.Substring(11, end_pos - 11);
                    String desc = i.Substring(end_pos + 3, i.Length - end_pos - 7);

                    String[] tab = new String[3];
                    tab[0] = "1";
                    tab[1] = "http://" + link + "/";
                    tab[2] = desc;

                    array_positions.Insert(0, tab);
                }
                else if (found2 == 0)
                {
                    String data = i.Substring(4, i.Length - 14);

                    String nb_tome = Regex.Match(data, @"\d+").Value;

                    int    pos_sep = data.IndexOf(":");
                    String title   = "";
                    if (pos_sep != -1)
                    {
                        title = data.Substring(pos_sep + 2);
                    }
                    else
                    {
                        title = "";
                    }

                    String[] tab = new String[3];
                    tab[0] = "2";
                    tab[1] = nb_tome;
                    tab[2] = title;

                    array_positions.Insert(0, tab);
                }
            }

            int pos_prompt = 0;
            int pos_elem   = 0;

            nb_tomes = 0;

            while (pos_prompt < array_positions.Count)
            {
                if (array_positions[pos_prompt][0] == "2")
                {
                    list_chapter.Add(array_positions[pos_prompt]);

                    while (pos_elem < pos_prompt)
                    {
                        list_chapter.Add(array_positions[pos_elem]);
                        pos_elem += 1;
                    }
                    pos_elem += 1;
                    nb_tomes += 1;
                }
                pos_prompt += 1;
            }

            if (pos_elem != array_positions.Count)
            {
                String[] tab = new String[3];
                tab[0] = "2";
                tab[1] = nb_tomes.ToString();
                tab[2] = "Last";

                list_chapter.Add(tab);

                while (pos_elem < array_positions.Count)
                {
                    list_chapter.Add(array_positions[pos_elem]);
                    pos_elem += 1;
                }
            }
        }
Пример #13
0
        public override void load_chapters(KeyValuePair <String, String> infos)
        {
            Debug.WriteLine("Load Chapter");
            String[] html = HtmlRequest.get_html(infos.Value);

            List <String[]> array_positions = new List <string[]>();

            this.name = infos.Key;
            this.link = infos.Value;

            list_chapter.Clear();
            int is_chapter_list = 0;
            int is_start        = 0;

            String[] tab;

            String link = "";
            String desc;

            foreach (String i in html)
            {
                if (i.IndexOf("has been licensed") != -1)
                {
                    tab = new String[3];

                    tab[0] = "1";
                    tab[1] = "";
                    tab[2] = "Manga has been licensed";

                    list_chapter.Add(tab);
                    break;
                }

                if (i.IndexOf("<div class=\"detail_list\">") != -1)
                {
                    is_chapter_list = 1;
                    Debug.WriteLine(i);
                }

                if (i.IndexOf("<a class=\"color_0077\"") != -1 && is_chapter_list == 1)
                {
                    is_start = 1;
                    link     = HtmlRequest.cut_str(i, "href=\"", "\" >");
                }
                if (i.IndexOf("</a>") != -1 && is_start == 1)
                {
                    is_start = 0;
                    desc     = i.Substring(0, i.IndexOf("</a>"));

                    tab = new String[3];

                    tab[0] = "1";
                    tab[1] = link;
                    tab[2] = desc;

                    list_chapter.Insert(0, tab);
                }
                if (i.IndexOf("class=\"tab_comment clearfix\">") != -1 && is_chapter_list == 1)
                {
                    is_chapter_list = 0;
                }
            }
            nb_tomes = 0;
        }