Continue to fix merge

This commit is contained in:
Mark Lee 2015-02-24 18:44:25 -08:00
parent 15e4f0ff84
commit be3544d251
3 changed files with 12 additions and 6 deletions

View File

@ -1031,6 +1031,9 @@ class YoutubeDL(object):
for j, part in enumerate(format['parts']): for j, part in enumerate(format['parts']):
if 'url' not in part: if 'url' not in part:
raise ExtractorError('Missing "url" key in result (index %d, part %d)' % (i, j)) raise ExtractorError('Missing "url" key in result (index %d, part %d)' % (i, j))
full_format_info = info_dict.copy()
full_format_info.update(part)
part['http_headers'] = self._calc_headers(full_format_info)
else: else:
if 'url' not in format: if 'url' not in format:
raise ExtractorError('Missing "url" key in result (index %d)' % i) raise ExtractorError('Missing "url" key in result (index %d)' % i)
@ -1046,11 +1049,12 @@ class YoutubeDL(object):
# Automatically determine file extension if missing # Automatically determine file extension if missing
if 'ext' not in format: if 'ext' not in format:
format['ext'] = determine_ext(format['url']).lower() format['ext'] = determine_ext(format['url']).lower()
# Add HTTP headers, so that external programs can use them from the if 'parts' not in format:
# json output # Add HTTP headers, so that external programs can use them from the
full_format_info = info_dict.copy() # json output
full_format_info.update(format) full_format_info = info_dict.copy()
format['http_headers'] = self._calc_headers(full_format_info) full_format_info.update(format)
format['http_headers'] = self._calc_headers(full_format_info)
format_limit = self.params.get('format_limit', None) format_limit = self.params.get('format_limit', None)
if format_limit: if format_limit:

View File

@ -234,6 +234,8 @@ def _real_main(argv=None):
if not opts.addmetadata: if not opts.addmetadata:
postprocessors.append({'key': 'FFmpegAudioFix'}) postprocessors.append({'key': 'FFmpegAudioFix'})
postprocessors.append({'key': 'AtomicParsley'}) postprocessors.append({'key': 'AtomicParsley'})
if opts.joinparts:
postprocessors.append({'key': 'FFmpegJoinVideos'})
# Please keep ExecAfterDownload towards the bottom as it allows the user to modify the final file in any way. # Please keep ExecAfterDownload towards the bottom as it allows the user to modify the final file in any way.
# So if the user is able to remove the file before your postprocessor runs it might cause a few problems. # So if the user is able to remove the file before your postprocessor runs it might cause a few problems.
if opts.exec_cmd: if opts.exec_cmd:

View File

@ -134,7 +134,7 @@ class FFmpegPostProcessor(PostProcessor):
files_cmd = [] files_cmd = []
for path in input_paths: for path in input_paths:
files_cmd.extend([encodeArgument('-i'), encodeFilename(path, True)]) files_cmd.extend([encodeArgument('-i'), encodeFilename(path, True)])
cmd = ([encodeFilename(self._executable, True), encodeArgument('-y')] + cmd = ([encodeFilename(self.executable, True), encodeArgument('-y')] +
[encodeArgument(o) for o in input_opts] + files_cmd + [encodeArgument(o) for o in opts] + [encodeArgument(o) for o in input_opts] + files_cmd + [encodeArgument(o) for o in opts] +
[encodeFilename(self._ffmpeg_filename_argument(out_path), True)]) [encodeFilename(self._ffmpeg_filename_argument(out_path), True)])