diff --git a/calibre-plugin/config.py b/calibre-plugin/config.py index 78a7ba3b..8b76b1e7 100644 --- a/calibre-plugin/config.py +++ b/calibre-plugin/config.py @@ -250,7 +250,7 @@ class ConfigWidget(QWidget): prefs['gcnewonly'] = self.generatecover_tab.gcnewonly.isChecked() gc_site_settings = {} for (site,combo) in self.generatecover_tab.gc_dropdowns.iteritems(): - val = unicode(combo.itemData(combo.currentIndex()).toString()) + val = unicode(combo.itemData(combo.currentIndex())) if val != 'none': gc_site_settings[site] = val #print("gc_site_settings[%s]:%s"%(site,gc_site_settings[site])) @@ -282,12 +282,12 @@ class ConfigWidget(QWidget): # Custom Columns tab # error column - prefs['errorcol'] = unicode(self.cust_columns_tab.errorcol.itemData(self.cust_columns_tab.errorcol.currentIndex()).toString()) + prefs['errorcol'] = unicode(self.cust_columns_tab.errorcol.itemData(self.cust_columns_tab.errorcol.currentIndex())) # cust cols tab colsmap = {} for (col,combo) in self.cust_columns_tab.custcol_dropdowns.iteritems(): - val = unicode(combo.itemData(combo.currentIndex()).toString()) + val = unicode(combo.itemData(combo.currentIndex())) if val != 'none': colsmap[col] = val #print("colsmap[%s]:%s"%(col,colsmap[col])) diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index a5759aec..d7c422d9 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -209,7 +209,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): #print("text/plain:%s"%event.mimeData().data(mimetype)) urllist.extend(get_urls_from_text(event.mimeData().data(mimetype))) - #print("urllist:%s\ndropped_ids:%s"%(urllist,dropped_ids)) + # print("urllist:%s\ndropped_ids:%s"%(urllist,dropped_ids)) if urllist or dropped_ids: QTimer.singleShot(1, partial(self.do_drop, dropped_ids=dropped_ids, diff --git a/defaults.ini b/defaults.ini index a4fc70e7..d60cdb64 100644 --- a/defaults.ini +++ b/defaults.ini @@ -634,7 +634,7 @@ extracategories:The Sentinel ## explicitly set the encoding and order if you need to. The special ## value 'auto' will call chardet and use the encoding it reports if ## it has +90% confidence. 'auto' is not reliable. -website_encodings:ISO-8859-1,auto +website_encodings:Windows-1252,ISO-8859-1,auto ## Extra metadata that this adapter knows about. See [dramione.org] ## for examples of how to use them. diff --git a/fanficdownloader/adapters/adapter_storiesonlinenet.py b/fanficdownloader/adapters/adapter_storiesonlinenet.py index 3f91b377..29022d7a 100644 --- a/fanficdownloader/adapters/adapter_storiesonlinenet.py +++ b/fanficdownloader/adapters/adapter_storiesonlinenet.py @@ -70,14 +70,14 @@ class StoriesOnlineNetAdapter(BaseSiteAdapter): ## Login seems to be reasonably standard across eFiction sites. def needToLoginCheck(self, data): - if 'Free Registration' in data \ + if self.needToLogin \ + or 'Free Registration' in data \ or "Invalid Password!" in data \ or "Invalid User Name!" in data \ or "Log In" in data \ or "Access to unlinked chapters requires" in data: - return True - else: - return False + self.needToLogin = True + return self.needToLogin def performLogin(self, url): params = {} @@ -114,11 +114,15 @@ class StoriesOnlineNetAdapter(BaseSiteAdapter): url = self.url logger.debug("URL: "+url) + self.needToLogin = False try: data = self._fetchUrl(url+":i") except urllib2.HTTPError, e: if e.code == 404: raise exceptions.StoryDoesNotExist(self.url) + elif e.code == 401: + self.needToLogin = True + data = '' else: raise e diff --git a/fanficdownloader/story.py b/fanficdownloader/story.py index 6e7c70dc..67148694 100644 --- a/fanficdownloader/story.py +++ b/fanficdownloader/story.py @@ -345,7 +345,7 @@ class Story(Configurable): except: self.setMetadata('langcode','en') - if key == 'dateUpdated': + if key == 'dateUpdated' and value: # Last Update tags for Bill. self.addToList('lastupdate',value.strftime("Last Update Year/Month: %Y/%m")) self.addToList('lastupdate',value.strftime("Last Update: %Y/%m/%d")) diff --git a/makezip.py b/makezip.py index 55a10197..fbab1d4c 100644 --- a/makezip.py +++ b/makezip.py @@ -1,9 +1,7 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# epubmerge.py 1.0 - -# Copyright 2011, Jim Miller +# Copyright 2014, Jim Miller # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/plugin-defaults.ini b/plugin-defaults.ini index 344650e3..803ce249 100644 --- a/plugin-defaults.ini +++ b/plugin-defaults.ini @@ -610,7 +610,7 @@ extracategories:The Sentinel ## explicitly set the encoding and order if you need to. The special ## value 'auto' will call chardet and use the encoding it reports if ## it has +90% confidence. 'auto' is not reliable. -website_encodings:ISO-8859-1,auto +website_encodings:Windows-1252,ISO-8859-1,auto ## Extra metadata that this adapter knows about. See [dramione.org] ## for examples of how to use them.