mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Only use dictionaries path workaround for HTTP 404 errors
This commit is contained in:
parent
0979c1a25c
commit
464c3a4c76
@ -163,7 +163,9 @@ def import_from_online(directory, name, dest_dir=None, prefix='dic-'):
|
||||
try:
|
||||
rp = br.open('/'.join((ONLINE_DICTIONARY_BASE_URL, directory, key)))
|
||||
return rp.read()
|
||||
except:
|
||||
except Exception as err:
|
||||
if getattr(err, 'code', -1) != 404:
|
||||
raise
|
||||
# Some dictionaries apparently put the dic and aff file in a
|
||||
# sub-directory dictionaries and incorrectly make paths relative
|
||||
# to that directory instead of the root, for example:
|
||||
|
Loading…
x
Reference in New Issue
Block a user