diff options
author | Ricardo Garcia <sarbalap+freshmeat@gmail.com> | 2008-07-21 23:58:16 +0200 |
---|---|---|
committer | Ricardo Garcia <devnull@localhost> | 2008-07-21 23:58:16 +0200 |
commit | b609fd549ffd7e3f8450f784eb34e84249d710c7 (patch) | |
tree | f9bcf9a4a2897f948870dfac6e25291d5324a951 | |
parent | 9fcd8355e57b4ef5605a015a0039d1bbe2375cf3 (diff) | |
download | youtube-dl-b609fd549ffd7e3f8450f784eb34e84249d710c7.tar.xz |
Add support for the "simulate" option
-rwxr-xr-x | youtube-dl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube-dl b/youtube-dl index adb4234c7..7323ad4f2 100755 --- a/youtube-dl +++ b/youtube-dl @@ -55,6 +55,7 @@ class FileDownloader(object): password: Password for authentication purposes. usenetrc: Use netrc for authentication instead. quiet: Do not print messages to stdout. + simulate: Do not download the video files. format: Video format code. 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: sys.exit('ERROR: fixed output name but more than one file to download') + if self._params.get('simulate', False): + continue + for result in results: try: filename = self._params['outtmpl'] % result @@ -435,6 +439,7 @@ if __name__ == '__main__': 'username': None, 'password': None, 'quiet': False, + 'simulate': True, 'format': None, 'outtmpl': '%(id)s.%(ext)s' }) |