public override List <String> prepareDownload(Chapters chapitre) { String link = chapitre.getLink(); string[] content = HtmlRequest.get_html(link); int nb_page = 0; List <String> listlinkPage = new List <string>(); int nb_list = 0; foreach (String i in content) { if (i.IndexOf("<select name=\"category_type\" class=\"form-control input-sm jump-menu\">") != -1) { nb_list++; } if (i.IndexOf("<option value=\"") != -1 && nb_list == 2) { if (nb_page > 0) { listlinkPage.Add(HtmlRequest.cut_str(i, "value=\"", "\">")); } else { listlinkPage.Add(HtmlRequest.cut_str(i, "value=\"", "\" selected")); } nb_page++; } } chapitre.setMax(nb_page); return(listlinkPage); }
public override List <String> prepareDownload(Chapters chapitre) { String link = chapitre.getLink(); string[] content = HtmlRequest.get_html(link); int nb_page = 0; List <String> listlinkPage = new List <string>(); foreach (String i in content) { if (i.IndexOf("<option value=\"") != -1) { if (nb_page > 0) { listlinkPage.Add("http://www.mangareader.net" + HtmlRequest.cut_str(i, "value=\"", "\">")); } else { listlinkPage.Add("http://www.mangareader.net" + HtmlRequest.cut_str(i, "value=\"", "\" selected")); } nb_page++; } } chapitre.setMax(nb_page); return(listlinkPage); }
public override void load_all_mangas() { allManga = new List <KeyValuePair <String, String> >(); for (int i = -1; i < 26; ++i) { String tmp_link = link_list_manga; if (i >= 0) { tmp_link = tmp_link + "/" + Convert.ToChar('a' + i); } String[] content = HtmlRequest.get_html(tmp_link); if (content == null) { allManga = null; return; } foreach (String j in content) { if (j.IndexOf("<span class=\"manga-item\">") != -1) { String str = HtmlRequest.cut_str(j, "<span class=\"icon-dot\"></span>", "</a>"); String link = HtmlRequest.cut_str(str, "<a href=\"", "\">"); String name = str.Substring(str.IndexOf("\">") + 2); allManga.Add(new KeyValuePair <String, String>(name, link)); } } } this.createFile(); }
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(""", "\"").Replace("&", "&"); String link = HtmlRequest.cut_str(m, "\" href=\"", "\"><span>"); allManga.Add(new KeyValuePair <String, String>(name, link)); } } } this.createFile(); }
public override void downloadScan(String link, int nb_page, Chapters chapitre, String path) { string[] content2 = HtmlRequest.get_html(link); foreach (String j in content2) { if (j.IndexOf("class=\"img-responsive\"") != -1) { MyPage p = new MyPage(nb_page, chapitre.getMax(), HtmlRequest.cut_str(j, "src=\"", "?u=\" class="), chapitre.getNumber(), chapitre.isChapter()); p.download(path); p = null; } } }
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)); } } this.createFile(); }
public override List <String> prepareDownload(Chapters chapitre) { String link = chapitre.getLink(); string[] content = HtmlRequest.get_html(link); int nb_page = 0; List <String> listlinkPage = new List <string>(); foreach (String i2 in content) { String i = i2.Replace("\t", ""); if (i.IndexOf("data-img") != -1 && i.IndexOf("data-img=\"IMG__") == -1 && i.IndexOf("__Add__") == -1) { listlinkPage.Add("http://www.japscan.com" + HtmlRequest.cut_str(i, "value=\"", "\">")); nb_page++; } } chapitre.setMax(nb_page); return(listlinkPage); }
public override void downloadScan(String link, int nb_page, Chapters chapitre, String path) { string[] content = HtmlRequest.get_html(link); foreach (String j2 in content) { String j = j2.Replace("\t", ""); if (j.IndexOf("itemprop=\"image\"") != -1) { MyPage p = new MyPage(nb_page, chapitre.getMax(), HtmlRequest.cut_str(j, "src=\"", "\" />"), chapitre.getNumber(), chapitre.isChapter()); if (p.link == "NOT FOUND") { p = new MyPage(nb_page, chapitre.getMax(), HtmlRequest.cut_str(j, "src=\"", "\"/>"), chapitre.getNumber(), chapitre.isChapter()); if (p.link == "NOT FOUND") { throw new Exception(); } } p.download(path); p = null; } } }
public override void downloadScan(String link, int nb_page, Chapters chapitre, String path) { string[] content2 = HtmlRequest.get_html(link); int reset = 0; while (content2.Length < 75 && reset < 5) { System.Threading.Thread.Sleep(1000); content2 = null; content2 = HtmlRequest.get_html(link); reset++; } foreach (String j in content2) { if (j.IndexOf("id=\"image\"") != -1) { MyPage p = new MyPage(nb_page, chapitre.getMax(), HtmlRequest.cut_str(j, "src=\"", "\" onload="), chapitre.getNumber(), chapitre.isChapter()); p.download(path); p = null; } } }
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 i2 in content) { String i = i2.Replace("\t", ""); 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 + "/")); } } this.createFile(); }
public override void load_chapters(KeyValuePair <String, String> infos) { String[] html = HtmlRequest.get_html(infos.Value); List <Chapters> array_positions = new List <Chapters>(); name = infos.Key; link = infos.Value; list_chapter.Clear(); int synopsis = 0; int author = 0; int chapter = 0; int picture = 0; String tmp_link = ""; int index = 0; int next_line = 0; Double tmp_number = 0; Chapters tmp_chapter = null; foreach (String i in html) { if (synopsis == 1) { synopsis = 0; resumé = HtmlRequest.cut_str(i, "\">", "</span></p>"); if (resumé == "NOT FOUND") { resumé = HtmlRequest.cut_str(i, "<p>", "</p>"); } if (resumé == "NOT FOUND") { resumé = ""; } } if (i.IndexOf("<li class=\"list-group-item movie-detail\">") != -1) { synopsis = 1; } if (author == 1 && i.IndexOf("<li><a href=\"") != -1) { author = 0; auteur = HtmlRequest.cut_str(i, "\">", "</a></li>"); } if (i.IndexOf("<ul class=\"cast-list clearfix\">") != -1) { author = 1; } if (picture == 1 && i.IndexOf("<img src=\"") != -1) { picture = 0; img_link = HtmlRequest.cut_str(i, "<img src=\"", "\" alt=\""); } if (i.IndexOf("<div class=\"col-md-3\">") != -1) { picture = 1; } if (i.IndexOf("<ul class=\"chp_lst\">") != -1) { chapter = 1; } if (i.IndexOf("<a href=\"") != -1 && chapter == 1) { tmp_link = HtmlRequest.cut_str(i, "<a href=\"", "\">"); } if (next_line == 1) { next_line = 0; if (tmp_number != -666) { tmp_chapter.date = HtmlRequest.cut_str(i, "\"> ", "</span>"); list_chapter.Add(tmp_chapter); } } if (i.IndexOf("<span class=\"val\"><span class=\"icon-arrow-2\"></span>") != -1) { String desc = HtmlRequest.cut_str(i, "\"></span>", " </span>"); if (desc == "NOT FOUND") { desc = i.Substring(i.IndexOf("\"></span>") + 9); } tmp_number = TryParseDouble(desc.Substring(name.Length + 3)); if (tmp_number != -666) { tmp_chapter = new Chapters(index, true, tmp_number, tmp_link + "/", null, null, null); index++; } next_line = 1; } } nb_tomes = 0; }
public override void load_chapters(KeyValuePair <String, String> infos) { String[] html = HtmlRequest.get_html(infos.Value); List <Chapters> array_positions = new List <Chapters>(); 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; int img = 0; int cpt_desc = 0; resumé = ""; int index = 0; Tome current_tome = null; Chapters current_chapter = null; foreach (String i in html) { if (i.IndexOf("has been licensed") != -1) { list_chapter.Add(new Chapters(-1, false, 0, "", null, "Manga has been licensed", null)); } if (i.IndexOf("<div class=\"detail_list\">") != -1) { is_chapter_list = 1; } if (i.IndexOf("<a class=\"color_0077\"") != -1 && is_chapter_list == 1) { is_start = 1; current_chapter = new Chapters(); link = HtmlRequest.cut_str(i, "href=\"", "\" >"); if (link == "NOT FOUND") { link = HtmlRequest.cut_str(i, "href=\"", "\" name"); } current_chapter.setLink(link); current_chapter.SetisChapter(true); } if (i.IndexOf("</a>") != -1 && is_start == 1) { desc = i.Substring(0, i.IndexOf("</a>")); current_chapter.setNumber(TryParseDouble(desc.Replace(name, ""))); } if (i.IndexOf("<span class=\"mr6\"") != -1 && is_start == 1) { int tome_nb = 0; if (i.IndexOf("Vol ") != -1) { tome_nb = Int32.Parse(HtmlRequest.cut_str(i, "Vol ", "</span>")); } if (current_tome == null || current_tome.getNumber() != tome_nb) { current_tome = new Tome(null, tome_nb); } current_chapter.setTome(current_tome); } if (i.IndexOf("<span class=\"right\">") != -1 && is_start == 1) { is_start = 0; current_chapter.setIndex(index); current_chapter.date = HtmlRequest.cut_str(i, "<span class=\"right\">", "</span>"); index++; list_chapter.Add(current_chapter); } if (i.IndexOf("class=\"tab_comment clearfix\">") != -1 && is_chapter_list == 1) { is_chapter_list = 0; } if (i.IndexOf("<li><label>Author(s):</label>") != -1) { auteur = HtmlRequest.cut_str(i, "\">", "</a></li>"); } if (img == 1) { img_link = HtmlRequest.cut_str(i, "<img src=\"", "\" onerror"); img = 0; } if (i.IndexOf("<div class=\"manga_detail_top clearfix\">") != -1) { img = 1; } if (i.IndexOf("<p id=\"show\" style=\"display:none;\">") != -1) { cpt_desc = 1; } if (cpt_desc == 1) { if (i.IndexOf("<p id=\"show\" style=\"display:none;\">") != -1 && i.IndexOf(" <a href=") != -1) { resumé = HtmlRequest.cut_str(i, "style=\"display:none;\">", " <a href="); } else if (i.IndexOf("<p id=\"show\" style=\"display:none;\">") != -1) { int pos = i.IndexOf("<p id=\"show\" style=\"display:none;\">") + 35; resumé += i.Substring(pos, i.Length - pos); } else if (i.IndexOf(" <a href=") != -1) { resumé += i.Substring(0, i.IndexOf(" <a href=")); } else { resumé += i; } } if (i.IndexOf(" <a href=") != -1 && cpt_desc == 1) { cpt_desc = 0; } } resumé = resumé.Replace(""", "\""); nb_tomes = 0; }
public override void load_chapters(KeyValuePair <String, String> infos) { String[] html = HtmlRequest.get_html(infos.Value); int found; name = infos.Key; link = infos.Value; list_chapter.Clear(); int is_start = 0; int is_line_start = 0; int det = 0; int index = 0; Double tmp_number = 0; String tmp_link = ""; String tmp_title = ""; foreach (String i in html) { found = i.IndexOf("<a href=\"/"); if (det == 1) { année = HtmlRequest.cut_str(i, "<td>", "</td>"); det = 0; } if (det == 2) { auteur = HtmlRequest.cut_str(i, "<td>", "</td>"); det = 0; } if (i.IndexOf("<td class=\"propertytitle\">Year of Release:</td>") == 0) { det = 1; } if (i.IndexOf("<td class=\"propertytitle\">Author:</td>") == 0) { det = 2; } if (i.IndexOf("<th class=\"leftgap\">Chapter Name</th>") != -1) { is_start = 1; } if (i.IndexOf("<a href=\"") != -1 && is_start == 1) { is_line_start = 1; } if (i.IndexOf("<div class=\"clear\"></div>") != -1 && is_start == 1) { is_start = 0; } if (i.IndexOf("<div id=\"mangaimg\">") == 0) { img_link = HtmlRequest.cut_str(i, "<div id=\"mangaimg\"><img src=\"", "\" alt="); } if (found == 0 && is_start == 1) { String link = HtmlRequest.cut_str(i, "<a href=\"", "\">"); String desc = HtmlRequest.cut_str(i, "\">", "</a>") + " : " + HtmlRequest.cut_str(i, "</a> : ", "</td>"); tmp_number = TryParseDouble(HtmlRequest.cut_str(i, "\">", "</a>").Substring(name.Length)); tmp_title = null; if (desc.IndexOf(" : ") != -1) { tmp_title = HtmlRequest.cut_str(i, "</a> : ", "</td>"); } tmp_link = "http://www.mangareader.net" + link + "/"; } if (i.IndexOf("<td>") != -1 && is_line_start == 1) { String date = HtmlRequest.cut_str(i, "<td>", "</td>"); list_chapter.Insert(0, new Chapters(index, true, tmp_number, tmp_link, null, tmp_title, date)); index++; is_line_start = 0; } } nb_tomes = 0; }