Browse Source

Add support for the "simulate" option

rtmp_test
Ricardo Garcia 17 years ago
committed by Ricardo Garcia
parent
commit
b609fd549f
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      youtube-dl

+ 5
- 0
youtube-dl View File

@ -55,6 +55,7 @@ class FileDownloader(object):
password: Password for authentication purposes. password: Password for authentication purposes.
usenetrc: Use netrc for authentication instead. usenetrc: Use netrc for authentication instead.
quiet: Do not print messages to stdout. quiet: Do not print messages to stdout.
simulate: Do not download the video files.
format: Video format code. format: Video format code.
outtmpl: Template for output names. outtmpl: Template for output names.
""" """
@ -162,6 +163,9 @@ class FileDownloader(object):
if (len(url_list) > 1 or len(results) > 1) and re.search(r'%\(.+?\)s', self._params['outtmpl']) is None: if (len(url_list) > 1 or len(results) > 1) and re.search(r'%\(.+?\)s', self._params['outtmpl']) is None:
sys.exit('ERROR: fixed output name but more than one file to download') sys.exit('ERROR: fixed output name but more than one file to download')
if self._params.get('simulate', False):
continue
for result in results: for result in results:
try: try:
filename = self._params['outtmpl'] % result filename = self._params['outtmpl'] % result
@ -435,6 +439,7 @@ if __name__ == '__main__':
'username': None, 'username': None,
'password': None, 'password': None,
'quiet': False, 'quiet': False,
'simulate': True,
'format': None, 'format': None,
'outtmpl': '%(id)s.%(ext)s' 'outtmpl': '%(id)s.%(ext)s'
}) })


Loading…
Cancel
Save