Add output_filename to --meta-only (#271)

This commit is contained in:
theit8514 2018-03-10 14:45:14 -05:00 committed by Jim Miller
parent 2eb5e6401d
commit 9cf3da6383

View file

@ -428,12 +428,6 @@ def do_download(arg,
metadata['zchapters'] = []
for i, x in enumerate(adapter.chapterUrls):
metadata['zchapters'].append((i+1,x[0],x[1]))
if options.jsonmeta:
import json
print json.dumps(metadata, sort_keys=True,
indent=2, separators=(',', ':'))
else:
pprint.pprint(metadata)
if not options.metaonly and adapter.getConfig('pre_process_cmd'):
if adapter.getConfig('pre_process_safepattern'):
@ -443,6 +437,15 @@ def do_download(arg,
call(string.Template(adapter.getConfig('pre_process_cmd')).substitute(metadata), shell=True)
output_filename = write_story(configuration, adapter, options.format, options.metaonly)
if options.metaonly:
metadata['output_filename'] = output_filename
if options.jsonmeta:
import json
print json.dumps(metadata, sort_keys=True,
indent=2, separators=(',', ':'))
else:
pprint.pprint(metadata)
if not options.metaonly and adapter.getConfig('post_process_cmd'):
if adapter.getConfig('post_process_safepattern'):