aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-03-01 21:08:50 +0100
committerremitamine <remitamine@gmail.com>2016-03-01 21:10:41 +0100
commitf17f86513eaa09c2945b4a48a28efe5152be7017 (patch)
tree3c0adc5d385be065aeb9c869e5f55d38aba1393f /youtube_dl/YoutubeDL.py
parent9fb556eef0c6e83594ca4a7fe4d924a6a2a43a60 (diff)
Add fixup for media files produced by HlsNative downloader(fixes #4776)
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-xyoutube_dl/YoutubeDL.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index f4324039c..97cf31eb2 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -87,6 +87,7 @@ from .extractor import get_info_extractor, gen_extractors
from .downloader import get_suitable_downloader
from .downloader.rtmp import rtmpdump_version
from .postprocessor import (
+ FFmpegFixupM3u8PP,
FFmpegFixupM4aPP,
FFmpegFixupStretchedPP,
FFmpegMergerPP,
@@ -1670,6 +1671,22 @@ class YoutubeDL(object):
else:
assert fixup_policy in ('ignore', 'never')
+ if info_dict.get('protocol') == 'm3u8_native' or info_dict.get('protocol') == 'm3u8' and self._downloader.params.get('hls_prefer_native', False):
+ if fixup_policy == 'warn':
+ self.report_warning('%s: malformated aac bitstream.' % (
+ info_dict['id']))
+ elif fixup_policy == 'detect_or_warn':
+ fixup_pp = FFmpegFixupM3u8PP(self)
+ if fixup_pp.available:
+ info_dict.setdefault('__postprocessors', [])
+ info_dict['__postprocessors'].append(fixup_pp)
+ else:
+ self.report_warning(
+ '%s: malformated aac bitstream. Install ffmpeg or avconv to fix this automatically.' % (
+ info_dict['id']))
+ else:
+ assert fixup_policy in ('ignore', 'never')
+
try:
self.post_process(filename, info_dict)
except (PostProcessingError) as err: