mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-26 10:33:21 +02:00
Get Books: Fix downloading of some books in formats that do not have metadata yielding nonsense titles
Merge branch 'master' of https://github.com/user-none/calibre
This commit is contained in:
commit
de2dbf73cd
1 changed files with 3 additions and 2 deletions
|
|
@ -15,7 +15,7 @@
|
|||
from calibre.ebooks import BOOK_EXTENSIONS
|
||||
from calibre.gui2 import Dispatcher
|
||||
from calibre.gui2.threaded_jobs import ThreadedJob
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.ptempfile import PersistentTemporaryDirectory
|
||||
from calibre.utils.filenames import ascii_filename
|
||||
|
||||
class EbookDownload(object):
|
||||
|
|
@ -56,7 +56,8 @@ def _download(self, cookie_file, url, filename, save_loc, add_to_lib):
|
|||
cj.load(cookie_file)
|
||||
br.set_cookiejar(cj)
|
||||
with closing(br.open(url)) as r:
|
||||
tf = PersistentTemporaryFile(suffix=filename)
|
||||
temp_path = os.path.join(PersistentTemporaryDirectory(), filename)
|
||||
tf = open(temp_path, 'w+b')
|
||||
tf.write(r.read())
|
||||
dfilename = tf.name
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue