- String linkImageLine = getLine(in, "return enlarge()", 1);
- String linkNext = null;
- String linkImage = null;
- pos = linkNextLine.indexOf("href=\"");
- if (pos >= 0) {
- linkNextLine = linkNextLine.substring(pos + "href=\"".length());
- pos = linkNextLine.indexOf('\"');
- if (pos >= 0) {
- linkNext = linkNextLine.substring(0, pos);
- }
- }
- pos = linkImageLine.indexOf("src=\"");
- if (pos >= 0) {
- linkImageLine = linkImageLine
- .substring(pos + "src=\"".length());
- pos = linkImageLine.indexOf('\"');
- if (pos >= 0) {
- linkImage = linkImageLine.substring(0, pos);
- }
- }
-
- if (linkImage != null) {
- builder.append("[");
- // to help with the retry and the originalUrl, part 1
- builder.append(withoutQuery(linkImage));
- builder.append("]<br/>");
- }
-
- // to help with the retry and the originalUrl, part 2
- refresh(linkImage);
- pg.setProgress((i++) % pg.getMax());
-
- if (close) {
- try {
- in.close();
- } catch (IOException e) {
- Instance.getTraceHandler().error(e);
- }
- }
+ Document chapDoc = DataUtil.load(Instance.getCache().open(chapUrl, this, false), "UTF-8", chapUrl.toString());
+
+ // Example of what we want:
+ // URL: http://fanfox.net/manga/solo_leveling/c110.5/1.html#ipg1
+ // IMAGE, not working:
+ // http://s.fanfox.net/store/manga/29037/110.5/compressed/s034.jpg?token=f630767b0c96f6cc793fc8f1fc177c0ae9342eb1&ttl=1585929600
+ // IMAGE, working:
+ // http://s.fanfox.net/store/manga/29037/000.0/compressed/m2018110o_143554_925.jpg?token=7d74569986335d49651ef1040f7dcb9dbd559b1b&ttl=1585929600
+ // NOTE: (c110.5 -> 110.5, c000 -> 000.0)
+ // NOTE: image key: m2018110o_143554_925 can be found in the script, but not
+ // sorted
+
+ // 0. Get the javascript content
+ StringBuilder javascript = new StringBuilder();
+ for (Element script : chapDoc.getElementsByTag("script")) {
+ javascript.append(script.html());
+ javascript.append("\n");
+ }