@Override public void parseComicURL() { // parse URL and save all URLs in comicURL // // 先取得前面的下載伺服器網址 String allPageString = getAllPageString(webSite); Common.debugPrint("開始解析這一集有幾頁 : "); String baseURL = "http://mh2.xindm.cn"; int beginIndex = allPageString.indexOf("Array("); beginIndex = allPageString.indexOf("\"", beginIndex); int endIndex = allPageString.indexOf(");", beginIndex); String tempPicString = allPageString.substring(beginIndex, endIndex); String[] picURLs = tempPicString.split(","); totalPage = picURLs.length; Common.debugPrintln("共 " + totalPage + " 頁"); comicURL = new String[totalPage]; for (int i = 0; i < picURLs.length; i++) { comicURL[i] = baseURL + picURLs[i].replaceAll("\"", ""); Common.debugPrintln("第" + (i + 1) + "頁網址:" + comicURL[i]); } // 須取得cookie才能下載圖片(防盜連專家....) String[] cookies = Common.getCookieStrings(webSite, null); String cookieString = ""; int cookieCount = 0; // 取得前兩組cookie就可以了 if (cookies[0] != null) { cookieString = "Hm_lvt_016bf6f495d44a067f569423ad894560=1337210178886; " + cookies[0].split(";")[0]; } Common.debugPrintln("取得cookies:" + cookieString); for (int p = 1; p <= totalPage && Run.isAlive; p++) { String referURL = webSite + "?p=" + p; // 每解析一個網址就下載一張圖 singlePageDownloadUsingSimple( getTitle(), getWholeTitle(), comicURL[p - 1], totalPage, p, cookieString, referURL); Common.debugPrintln((p) + " " + comicURL[p - 1] + " " + referURL); // debug } // System.exit(1); // debug }