- protected String getChapterContent(URL source, InputStream in, int number) {
- StringBuilder builder = new StringBuilder();
- String base = getCurrentReferer().toString();
- int pos = base.lastIndexOf('/');
- base = base.substring(0, pos + 1); // including the '/' at the end
-
- boolean close = false;
- while (in != null) {
- String linkNextLine = getLine(in, "return enlarge()", 0);
- try {
- in.reset();
- } catch (IOException e) {
- Instance.syserr(e);
- }
-
- 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/>");
- }