Browse Source

[hls] Simplify

master
Sergey M․ 9 years ago
parent
commit
4a3da4ebdb
1 changed files with 5 additions and 5 deletions
  1. 10
      youtube_dl/downloader/hls.py

10
youtube_dl/downloader/hls.py

@ -29,15 +29,15 @@ class HlsFD(FileDownloader):
return False return False
ffpp.check_version() ffpp.check_version()
args = [encodeArgument(opt) for opt in ('-y', '-i', url, '-f', 'mp4', '-c', 'copy', '-bsf:a', 'aac_adtstoasc')]
args = [
encodeArgument(opt)
for opt in (program, '-y', '-i', url, '-f', 'mp4', '-c', 'copy', '-bsf:a', 'aac_adtstoasc')]
args.append(encodeFilename(tmpfilename, True)) args.append(encodeFilename(tmpfilename, True))
cmd = [encodeArgument(program)] + args
retval = subprocess.call(cmd)
retval = subprocess.call(args)
if retval == 0: if retval == 0:
fsize = os.path.getsize(encodeFilename(tmpfilename)) 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.try_rename(tmpfilename, filename)
self._hook_progress({ self._hook_progress({
'downloaded_bytes': fsize, 'downloaded_bytes': fsize,

Loading…
Cancel
Save