From 28e07f87989468ea684e2f785354de1ff26b0204 Mon Sep 17 00:00:00 2001 From: haleydu <924323178@qq.com> Date: Sun, 30 Aug 2020 23:08:25 +0800 Subject: [PATCH] fix dmzjv2, closed #93 --- .../java/com/hiroshi/cimoc/source/Dmzjv2.java | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/hiroshi/cimoc/source/Dmzjv2.java b/app/src/main/java/com/hiroshi/cimoc/source/Dmzjv2.java index bb1486d1..24fb95d8 100644 --- a/app/src/main/java/com/hiroshi/cimoc/source/Dmzjv2.java +++ b/app/src/main/java/com/hiroshi/cimoc/source/Dmzjv2.java @@ -1,5 +1,6 @@ package com.hiroshi.cimoc.source; +import android.util.Log; import android.util.Pair; import com.hiroshi.cimoc.model.Chapter; @@ -13,6 +14,7 @@ import com.hiroshi.cimoc.parser.SearchIterator; import com.hiroshi.cimoc.parser.UrlFilter; import com.hiroshi.cimoc.soup.Node; +import com.hiroshi.cimoc.utils.LogUtil; import com.hiroshi.cimoc.utils.StringUtils; import com.hiroshi.cimoc.utils.UicodeBackslashU; @@ -118,30 +120,36 @@ public Comic parseInfo(String html, Comic comic) { @Override public List parseChapter(String html, Comic comic) { + LogUtil.iLength("hrd",html); List list = new LinkedList<>(); try { - String JsonString = StringUtils.match(":(\\[\\{.*?\\}\\])\\}\\]", html, 1); - String decodeJsonString = UicodeBackslashU.unicodeToCn(JsonString); - JSONArray JSONArray = new JSONArray(decodeJsonString); + String JsonArrayString = StringUtils.match("initIntroData\\((.*)\\);", html, 1); + String decodeJsonArrayString = UicodeBackslashU.unicodeToCn(JsonArrayString); + JSONArray allJsonArray = new JSONArray(decodeJsonArrayString); int k=0; - for (int j = 0; j != JSONArray.length(); ++j) { - Long sourceComic=null; - if (comic.getId() == null) { - sourceComic = Long.parseLong(comic.getSource() + sourceToComic + "00"); - } else { - sourceComic = Long.parseLong(comic.getSource() + sourceToComic + comic.getId()); + for (int i=0;i