Version 1.4.2: fix for images documents...
[fanfix.git] / src / be / nikiroo / fanfix / supported / E621.java
index 476e88b77765e741235909c53f3d82166302399c..05d122e68b89efc71587fda628f9b17e720736d7 100644 (file)
@@ -13,6 +13,7 @@ import be.nikiroo.fanfix.Instance;
 import be.nikiroo.fanfix.data.Chapter;
 import be.nikiroo.fanfix.data.MetaData;
 import be.nikiroo.fanfix.data.Story;
+import be.nikiroo.utils.Progress;
 import be.nikiroo.utils.StringUtils;
 
 /**
@@ -45,18 +46,19 @@ class E621 extends BasicSupport {
                meta.setUuid(source.toString());
                meta.setLuid("");
                meta.setLang("EN");
-               meta.setSubject("");
+               meta.setSubject("Furry");
                meta.setType(getType().toString());
                meta.setImageDocument(true);
                meta.setCover(getCover(source));
+               meta.setFakeCover(true);
 
                return meta;
        }
 
        @Override
-       public Story process(URL url) throws IOException {
+       public Story process(URL url, Progress pg) throws IOException {
                // There is no chapters on e621, just pagination...
-               Story story = super.process(url);
+               Story story = super.process(url, pg);
 
                Chapter only = new Chapter(1, null);
                for (Chapter chap : story) {
@@ -90,7 +92,7 @@ class E621 extends BasicSupport {
                String images = getChapterContent(new URL(source.toString() + "?page="
                                + 1), in, 1);
                if (!images.isEmpty()) {
-                       int pos = images.indexOf('\n');
+                       int pos = images.indexOf("<br/>");
                        if (pos >= 0) {
                                images = images.substring(1, pos - 1);
                                return getImage(this, null, images);
@@ -253,7 +255,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);
@@ -266,7 +268,7 @@ class E621 extends BasicSupport {
                                                        id = id.substring(0, dotPos);
                                                        builder.append("[");
                                                        builder.append(id);
-                                                       builder.append("]\n");
+                                                       builder.append("]<br/>");
                                                }
                                        }
                                }