e621: fix detection of "?tags" urls
[fanfix.git] / src / be / nikiroo / fanfix / supported / E621.java
index d6cbad40744743f27550e66b8f3357caa1be2591..aa9c8af1ee26690cdd86429a911d2b1b7a2d9fa3 100644 (file)
@@ -6,14 +6,11 @@ import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLDecoder;
-import java.net.URLEncoder;
 import java.util.AbstractMap;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.AbstractMap.SimpleEntry;
 import java.util.Map.Entry;
 import java.util.Scanner;
 
@@ -384,7 +381,7 @@ class E621 extends BasicSupport_Deprecated {
                        if (source.toString().contains(key)) {
                                int pos = source.toString().indexOf(key);
                                String tags = source.toString().substring(pos + key.length());
-                               tags = tags.replace("+", "%32");
+                               tags = tags.replace("+", "%20");
                                try {
                                        return new URL(source.toString().substring(0, pos)
                                                        + "post/index/1/" + tags);
@@ -402,7 +399,7 @@ class E621 extends BasicSupport_Deprecated {
 
        private boolean isSearch(URL url) {
                return url.getPath().startsWith("/post/index/")
-                               || (url.getPath().equals("/post") && url.getQuery().startsWith(
-                                               "tags="));
+                               || (url.getPath().equals("/post/search") && url.getQuery()
+                                               .startsWith("tags="));
        }
 }