X-Git-Url: https://git.nikiroo.be/?a=blobdiff_plain;ds=inline;f=src%2Fbe%2Fnikiroo%2Ffanfix%2Fsupported%2FE621.java;h=5ebd6b317661cf0ff2b1ff0cf357559df469b380;hb=bee7dffea9ef8d3312eee90993a9faaeac6c1127;hp=cb4ae4657a7807c104cb5c7dbefe7324f015e9de;hpb=2206ef66ee00ad42d806f04a7b7ad6f8cb2d8828;p=fanfix.git
diff --git a/src/be/nikiroo/fanfix/supported/E621.java b/src/be/nikiroo/fanfix/supported/E621.java
index cb4ae46..5ebd6b3 100644
--- a/src/be/nikiroo/fanfix/supported/E621.java
+++ b/src/be/nikiroo/fanfix/supported/E621.java
@@ -1,5 +1,6 @@
package be.nikiroo.fanfix.supported;
+import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -13,6 +14,7 @@ import be.nikiroo.fanfix.data.Chapter;
import be.nikiroo.fanfix.data.MetaData;
import be.nikiroo.fanfix.data.Story;
import be.nikiroo.utils.StringUtils;
+import be.nikiroo.utils.ui.Progress;
/**
* Support class for e621.net and = 0) {
+ images = images.substring(1, pos - 1);
+ return getImage(this, null, images);
+ }
+ }
+
+ return null;
+ }
+
private String getAuthor(URL source, InputStream in) throws IOException {
String author = getLine(in, "href=\"/post/show/", 0);
if (author != null) {
@@ -96,24 +113,28 @@ class E621 extends BasicSupport {
author = author.substring(0, pos - 1);
String page = source.getProtocol() + "://"
+ source.getHost() + author;
- InputStream pageIn = Instance.getCache().open(
- new URL(page), this, false);
try {
- key = "class=\"tag-type-artist\"";
- author = getLine(pageIn, key, 0);
- if (author != null) {
- pos = author.indexOf("= 0) {
- author = author.substring(pos);
- pos = author.indexOf("");
+ InputStream pageIn = Instance.getCache().open(
+ new URL(page), this, false);
+ try {
+ key = "class=\"tag-type-artist\"";
+ author = getLine(pageIn, key, 0);
+ if (author != null) {
+ pos = author.indexOf("= 0) {
- author = author.substring(0, pos);
- return StringUtils.unhtml(author);
+ author = author.substring(pos);
+ pos = author.indexOf("");
+ if (pos >= 0) {
+ author = author.substring(0, pos);
+ return StringUtils.unhtml(author);
+ }
}
}
+ } finally {
+ pageIn.close();
}
- } finally {
- pageIn.close();
+ } catch (Exception e) {
+ // No author found
}
}
}
@@ -233,7 +254,7 @@ class E621 extends BasicSupport {
scan.useDelimiter("\\n");
while (scan.hasNext()) {
String line = scan.next();
- if (line.contains("class=\"preview\"")) {
+ if (line.contains("class=\"preview")) {
for (int pos = line.indexOf(key); pos >= 0; pos = line.indexOf(
key, pos + key.length())) {
int endPos = line.indexOf("\"", pos);