X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fpostprocessor%2Fffmpeg.py;h=380bc6f292f2390fdf5dabd131a20184ba8334df;hb=2b2dfae83ef80f86e9983ded3c4514b58b1eed60;hp=d3d9d4f1da13be926b05714f04f801ce0f664613;hpb=fae45ede082e50a4935e014b47cbfde925c0f8ed;p=youtube-dl diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index d3d9d4f1d..380bc6f29 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -392,7 +392,7 @@ class FFmpegMetadataPP(FFmpegPostProcessor): options.extend(['-metadata', '%s=%s' % (name, value)]) # https://github.com/rg3/youtube-dl/issues/8350 - if info['protocol'] == 'm3u8_native': + if info.get('protocol') == 'm3u8_native' or info.get('protocol') == 'm3u8' and self._downloader.params.get('hls_prefer_native', False): options.extend(['-bsf:a', 'aac_adtstoasc']) self._downloader.to_screen('[ffmpeg] Adding metadata to \'%s\'' % filename) @@ -508,8 +508,8 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor): with io.open(srt_file, 'wt', encoding='utf-8') as f: f.write(srt_data) + old_file = srt_file - ext = 'srt' subs[lang] = { 'ext': 'srt', 'data': srt_data @@ -517,12 +517,14 @@ class FFmpegSubtitlesConvertorPP(FFmpegPostProcessor): if new_ext == 'srt': continue + else: + sub_filenames.append(srt_file) self.run_ffmpeg(old_file, new_file, ['-f', new_format]) with io.open(new_file, 'rt', encoding='utf-8') as f: subs[lang] = { - 'ext': ext, + 'ext': new_ext, 'data': f.read(), }