X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fdownloader%2Fhls.py;h=e527ee425365a096b50f541b1c75c82dcb9013fb;hb=4a3da4ebdb1de5e35b47176822ab9ed3b2762c3f;hp=aa58b52abb5998ba8879e6eba3a1d974484467e2;hpb=63948fc62c7f0bfcfe7b2ce102ab6e4e87de558c;p=youtube-dl diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py index aa58b52ab..e527ee425 100644 --- a/youtube_dl/downloader/hls.py +++ b/youtube_dl/downloader/hls.py @@ -11,6 +11,7 @@ from ..compat import ( compat_urllib_request, ) from ..utils import ( + encodeArgument, encodeFilename, ) @@ -21,23 +22,22 @@ class HlsFD(FileDownloader): self.report_destination(filename) tmpfilename = self.temp_name(filename) - args = [ - '-y', '-i', url, '-f', 'mp4', '-c', 'copy', - '-bsf:a', 'aac_adtstoasc', - encodeFilename(tmpfilename, for_subprocess=True)] - ffpp = FFmpegPostProcessor(downloader=self) program = ffpp._executable if program is None: self.report_error('m3u8 download detected but ffmpeg or avconv could not be found. Please install one.') return False ffpp.check_version() - cmd = [program] + args - retval = subprocess.call(cmd) + args = [ + encodeArgument(opt) + for opt in (program, '-y', '-i', url, '-f', 'mp4', '-c', 'copy', '-bsf:a', 'aac_adtstoasc')] + args.append(encodeFilename(tmpfilename, True)) + + retval = subprocess.call(args) if retval == 0: fsize = os.path.getsize(encodeFilename(tmpfilename)) - self.to_screen('\r[%s] %s bytes' % (cmd[0], fsize)) + self.to_screen('\r[%s] %s bytes' % (args[0], fsize)) self.try_rename(tmpfilename, filename) self._hook_progress({ 'downloaded_bytes': fsize,