mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-30 14:03:54 +02:00
Fix downloading ebooks from Project Gutenberg via the builtin browser not working because of changes to the Project Gutenberg website. Fixes #1366240 [EPUB download from Project Gutenberg not recognized, errors copying to itself](https://bugs.launchpad.net/calibre/+bug/1366240)
This commit is contained in:
parent
212a2df4d1
commit
071b97a0de
1 changed files with 3 additions and 1 deletions
|
|
@ -6,10 +6,12 @@ class Recipe(object):
|
|||
pass
|
||||
|
||||
def get_download_filename_from_response(response):
|
||||
from urlparse import urlparse
|
||||
from urllib2 import unquote as urllib2_unquote
|
||||
filename = last_part_name = ''
|
||||
try:
|
||||
last_part_name = response.geturl().split('/')[-1]
|
||||
purl = urlparse(response.geturl())
|
||||
last_part_name = purl.path.split('/')[-1]
|
||||
disposition = response.info().get('Content-disposition', '')
|
||||
for p in disposition.split(';'):
|
||||
if 'filename' in p:
|
||||
|
|
|
|||
Loading…
Reference in a new issue