code cleanup
[fanfix.git] / src / be / nikiroo / fanfix / supported / EHentai.java
index 2fe70d9714a7cbe396a42f2a572a020f1b18c219..9ed4e89e60996c6683876e543803ca55581117ad 100644 (file)
@@ -4,8 +4,10 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Scanner;
 
@@ -78,6 +80,13 @@ class EHentai extends BasicSupport_Deprecated {
                return true;
        }
 
+       @Override
+       public Map<String, String> getCookies() {
+               Map<String, String> cookies = super.getCookies();
+               cookies.put("nw", "1");
+               return cookies;
+       }
+
        private Image getCover(URL source, InputStream in) {
                Image author = null;
                String coverLine = getKeyLine(in, "<div id=\"gd1\"", " url(", ")");
@@ -229,24 +238,8 @@ class EHentai extends BasicSupport_Deprecated {
                }
 
                for (int i = 0; i <= last; i++) {
-                       final String key = Integer.toString(i + 1);
-                       final URL value = new URL(source.toString() + "?p=" + i);
-                       urls.add(new Entry<String, URL>() {
-                               @Override
-                               public URL setValue(URL value) {
-                                       return null;
-                               }
-
-                               @Override
-                               public URL getValue() {
-                                       return value;
-                               }
-
-                               @Override
-                               public String getKey() {
-                                       return key;
-                               }
-                       });
+                       urls.add(new AbstractMap.SimpleEntry<String, URL>(Integer
+                                       .toString(i + 1), new URL(source.toString() + "?p=" + i)));
                }
 
                return urls;