Partially fix YiffStar support
[fanfix.git] / src / be / nikiroo / fanfix / supported / BasicSupport.java
index 129182208f29f0ce70d46ffb70053231d0792a30..b528cac819acea887acfc28f861b9c32221d1971 100644 (file)
@@ -243,6 +243,16 @@ public abstract class BasicSupport {
        protected abstract String getChapterContent(URL source, InputStream in,
                        int number) throws IOException;
 
+       /**
+        * Log into the support (can be a no-op depending upon the support).
+        * 
+        * @throws IOException
+        *             in case of I/O error
+        */
+       public void login() throws IOException {
+
+       }
+
        /**
         * Return the list of cookies (values included) that must be used to
         * correctly fetch the resources.
@@ -251,8 +261,11 @@ public abstract class BasicSupport {
         * it.
         * 
         * @return the cookies
+        * 
+        * @throws IOException
+        *             in case of I/O error
         */
-       public Map<String, String> getCookies() {
+       public Map<String, String> getCookies() throws IOException {
                return new HashMap<String, String>();
        }
 
@@ -304,6 +317,8 @@ public abstract class BasicSupport {
         */
        protected Story processMeta(URL url, boolean close, boolean getDesc)
                        throws IOException {
+               login();
+
                url = getCanonicalUrl(url);
 
                setCurrentReferer(url);