mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix downloading of news that has non-English characters in its title on windows. Fixes #3005 (RSS Fetching from zaobao.com still fail)
This commit is contained in:
parent
31d46786e5
commit
f3635ab09c
@ -51,6 +51,7 @@ class Plumber(object):
|
||||
:param input: Path to input file.
|
||||
:param output: Path to output file/directory
|
||||
'''
|
||||
self.original_input_arg = input
|
||||
self.input = os.path.abspath(input)
|
||||
self.output = os.path.abspath(output)
|
||||
self.log = log
|
||||
@ -636,6 +637,8 @@ OptionRecommendation(name='language',
|
||||
tdir = PersistentTemporaryDirectory('_plumber')
|
||||
stream = self.input if self.input_fmt == 'recipe' else \
|
||||
open(self.input, 'rb')
|
||||
if self.input_fmt == 'recipe':
|
||||
self.opts.original_recipe_input_arg = self.original_input_arg
|
||||
|
||||
if hasattr(self.opts, 'lrf') and self.output_plugin.file_type == 'lrf':
|
||||
self.opts.lrf = True
|
||||
|
@ -48,11 +48,12 @@ class RecipeInput(InputFormatPlugin):
|
||||
if os.access(recipe_or_file, os.R_OK):
|
||||
recipe = compile_recipe(open(recipe_or_file, 'rb').read())
|
||||
else:
|
||||
title = os.path.basename(recipe_or_file).rpartition('.')[0]
|
||||
title = getattr(opts, 'original_recipe_input_arg', recipe_or_file)
|
||||
title = os.path.basename(title).rpartition('.')[0]
|
||||
recipe = get_builtin_recipe(title)
|
||||
|
||||
if recipe is None:
|
||||
raise ValueError('%s is not a valid recipe file or builtin recipe' %
|
||||
raise ValueError('%r is not a valid recipe file or builtin recipe' %
|
||||
recipe_or_file)
|
||||
|
||||
ro = recipe(opts, log, self.report_progress)
|
||||
|
Loading…
x
Reference in New Issue
Block a user