X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fdownloader%2Fhls.py;h=5bb0f3cfd19632f126d4f7d7b0df407b608778fc;hb=ee45625290c678c53b7ee86d2adba40847b79573;hp=68eafa403df4ad157feb13174584786205b41bea;hpb=f0b8e3607db6bc2e7cdfcf3175e85d9bccb22229;p=youtube-dl.git diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py index 68eafa403..5bb0f3cfd 100644 --- a/youtube_dl/downloader/hls.py +++ b/youtube_dl/downloader/hls.py @@ -4,10 +4,13 @@ import os import re import subprocess +from ..postprocessor.ffmpeg import FFmpegPostProcessor from .common import FileDownloader -from ..utils import ( +from ..compat import ( compat_urlparse, compat_urllib_request, +) +from ..utils import ( check_executable, encodeFilename, ) @@ -28,14 +31,17 @@ class HlsFD(FileDownloader): if check_executable(program, ['-version']): break else: - self.report_error(u'm3u8 download detected but ffmpeg or avconv could not be found. Please install one.') + self.report_error('m3u8 download detected but ffmpeg or avconv could not be found. Please install one.') return False cmd = [program] + args + ffpp = FFmpegPostProcessor(downloader=self) + ffpp.check_version() + retval = subprocess.call(cmd) if retval == 0: fsize = os.path.getsize(encodeFilename(tmpfilename)) - self.to_screen(u'\r[%s] %s bytes' % (cmd[0], fsize)) + self.to_screen('\r[%s] %s bytes' % (cmd[0], fsize)) self.try_rename(tmpfilename, filename) self._hook_progress({ 'downloaded_bytes': fsize, @@ -45,8 +51,8 @@ class HlsFD(FileDownloader): }) return True else: - self.to_stderr(u"\n") - self.report_error(u'%s exited with code %d' % (program, retval)) + self.to_stderr('\n') + self.report_error('%s exited with code %d' % (program, retval)) return False @@ -101,4 +107,3 @@ class NativeHlsFD(FileDownloader): }) self.try_rename(tmpfilename, filename) return True -