diff --git a/app.yaml b/app.yaml index b4ae8cf..2ae8ae4 100644 --- a/app.yaml +++ b/app.yaml @@ -1,6 +1,6 @@ # ffd-retief-hrd fanfictiondownloader application: fanfictiondownloader -version: 4-4-93 +version: 4-4-94 runtime: python27 api_version: 1 threadsafe: true diff --git a/calibre-plugin/__init__.py b/calibre-plugin/__init__.py index 4f6d808..cb90225 100644 --- a/calibre-plugin/__init__.py +++ b/calibre-plugin/__init__.py @@ -42,7 +42,7 @@ class FanFictionDownLoaderBase(InterfaceActionBase): description = _('UI plugin to download FanFiction stories from various sites.') supported_platforms = ['windows', 'osx', 'linux'] author = 'Jim Miller' - version = (1, 8, 12) + version = (1, 8, 13) minimum_calibre_version = (1, 13, 0) #: This field defines the GUI plugin class that contains all the code diff --git a/calibre-plugin/ffdl_plugin.py b/calibre-plugin/ffdl_plugin.py index 6c254d9..f0ed021 100644 --- a/calibre-plugin/ffdl_plugin.py +++ b/calibre-plugin/ffdl_plugin.py @@ -1797,6 +1797,7 @@ class FanFictionDownLoaderPlugin(InterfaceAction): book['end'] = None book['comment'] = '' # note this is a comment on the d/l or update. book['url'] = '' + book['site'] = '' book['added'] = False return book diff --git a/fanficdownloader/adapters/__init__.py b/fanficdownloader/adapters/__init__.py index 85c5f3c..5875beb 100644 --- a/fanficdownloader/adapters/__init__.py +++ b/fanficdownloader/adapters/__init__.py @@ -201,7 +201,7 @@ def getConfigSectionFor(url): def getClassFor(url): ## fix up leading protocol. - fixedurl = re.sub(r"(?i)^[htps]+[:/]+","http://",url.strip()) + fixedurl = re.sub(r"(?i)^[htp]+(s?)[:/]+",r"http\1://",url.strip()) if not fixedurl.startswith("http"): fixedurl = "http://%s"%url ## remove any trailing '#' locations. diff --git a/fanficdownloader/adapters/base_adapter.py b/fanficdownloader/adapters/base_adapter.py index 0da91cf..448be87 100644 --- a/fanficdownloader/adapters/base_adapter.py +++ b/fanficdownloader/adapters/base_adapter.py @@ -187,6 +187,11 @@ class BaseSiteAdapter(Configurable): time.sleep(sleeptime) try: return self._decode(self._fetchUrlRaw(url,parameters)) + except u2.HTTPError, he: + if he.code == 404: + logger.warn("Caught an exception reading URL: %s Exception %s."%(unicode(url),unicode(he))) + excpt=he + break # break out on 404 except Exception, e: excpt=e logger.warn("Caught an exception reading URL: %s Exception %s."%(unicode(url),unicode(e)))