It seems Kobo has added an extra requirement to successfully download a kepub file. As is known, the file downloading should end with .epub. Now not only the Content-Dispositionheader should be changed, but it seems that also the file path seems to be required to link to a filename the browser can download.
Possible fix
I am not a Python/Flask/Jinja developer, but I have found a workaround which works for my case. I am pretty sure it wouldn't be a "correct" fix for the general codebase. I am sure a seasoned Python developer can fix this in no-time at all :-).
My fix is changing the detail.html template. Wherever a download URL is created, I append the .epub in case the kepub format is used. In general, I can see it doesn't really matter what is put in the last part of the download URL for the inner workings of calibre-web since the route does not use this part of the path.
Describe the bug/problem
It seems Kobo has added an extra requirement to successfully download a
kepub
file. As is known, the file downloading should end with.epub
. Now not only theContent-Disposition
header should be changed, but it seems that also the file path seems to be required to link to a filename the browser can download.Possible fix
I am not a Python/Flask/Jinja developer, but I have found a workaround which works for my case. I am pretty sure it wouldn't be a "correct" fix for the general codebase. I am sure a seasoned Python developer can fix this in no-time at all :-).
My fix is changing the
detail.html
template. Wherever a download URL is created, I append the.epub
in case thekepub
format is used. In general, I can see it doesn't really matter what is put in the last part of the download URL for the inner workings of calibre-web since the route does not use this part of the path.The change would be:
<a href="{{ url_for('web.download_link', book_id=entry.id, book_format=format.format|lower, anyname=entry.id|string+'.'+format.format|lower) }}"
To
<a href="{{ url_for('web.download_link', book_id=entry.id, book_format=format.format|lower, anyname=entry.id|string+'.'+format.format|lower|replace('kepub', 'kepub.epub')) }}"
To reproduce the problem
Steps to reproduce the behavior: