mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-08 12:36:11 +02:00
Kludge fix for incorrect HTTP response 500 code from trekfanfiction.net.
This commit is contained in:
parent
10b9050e57
commit
a83563961c
1 changed files with 6 additions and 0 deletions
|
|
@ -1201,6 +1201,12 @@ class Configuration(configparser.SafeConfigParser):
|
|||
if he.code in (403,404,410):
|
||||
logger.debug("Caught an exception reading URL: %s Exception %s."%(unicode(safe_url(url)),unicode(he)))
|
||||
break # break out on 404
|
||||
## trekfanfiction.net has started returning the page,
|
||||
## but with a 500 code. We can use the HTTPError as
|
||||
## the 'opened' in such case.
|
||||
if he.code == 500 and 'trekfanfiction.net' in url:
|
||||
data = he.read()
|
||||
return (self._do_reduce_zalgo(self._decode(data)),he)
|
||||
except Exception as e:
|
||||
excpt=e
|
||||
logger.debug("Caught an exception reading URL: %s sleeptime(%s) Exception %s."%(unicode(safe_url(url)),sleeptime,unicode(e)))
|
||||
|
|
|
|||
Loading…
Reference in a new issue