mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-04-26 00:43:08 +02:00
Fix for KeyError:'site' error and https with ffnet.
Also don't retry 404 errors and bump versions.
This commit is contained in:
parent
35b5eb3dee
commit
d60ad9892d
5 changed files with 9 additions and 3 deletions
2
app.yaml
2
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue