diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-05-13 09:06:18 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-05-13 09:06:18 +0200 |
commit | 1bd96c3a60e40d2490be834f95b9acca6c74eb07 (patch) | |
tree | c964283f7b6a7c169538edacf249e954722fc06b /youtube_dl | |
parent | 929f85d851748acb385c17342201f6469f193a17 (diff) |
Deprecate --only-sub
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/FileDownloader.py | 8 | ||||
-rw-r--r-- | youtube_dl/__init__.py | 5 |
2 files changed, 4 insertions, 9 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index eb68d9478..8a3bdf21b 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -83,7 +83,6 @@ class FileDownloader(object): writeinfojson: Write the video description to a .info.json file writethumbnail: Write the thumbnail image to a file writesubtitles: Write the video subtitles to a file - onlysubtitles: Downloads only the subtitles of the video allsubtitles: Downloads all the subtitles of the video listsubtitles: Lists all available subtitles for the video subtitlesformat: Subtitle format [sbv/srt] (default=srt) @@ -93,6 +92,7 @@ class FileDownloader(object): min_filesize: Skip files smaller than this size max_filesize: Skip files larger than this size daterange: A DateRange object, download only if the upload_date is in the range. + skip_download: Skip the actual download of the video file """ params = None @@ -597,7 +597,7 @@ class FileDownloader(object): try: dn = os.path.dirname(encodeFilename(filename)) - if dn != '' and not os.path.exists(dn): # dn is already encoded + if dn != '' and not os.path.exists(dn): os.makedirs(dn) except (OSError, IOError) as err: self.report_error(u'unable to create directory ' + compat_str(err)) @@ -630,8 +630,6 @@ class FileDownloader(object): except (OSError, IOError): self.report_error(u'Cannot write subtitles file ' + descfn) return - if self.params.get('onlysubtitles', False): - return if self.params.get('allsubtitles', False) and 'subtitles' in info_dict and info_dict['subtitles']: subtitles = info_dict['subtitles'] @@ -649,8 +647,6 @@ class FileDownloader(object): except (OSError, IOError): self.report_error(u'Cannot write subtitles file ' + descfn) return - if self.params.get('onlysubtitles', False): - return if self.params.get('writeinfojson', False): infofn = filename + u'.info.json' diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 80f3b9f33..308c48fe6 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -191,8 +191,8 @@ def parseOpts(overrideArguments=None): action='store_true', dest='writesubtitles', help='write subtitle file (currently youtube only)', default=False) video_format.add_option('--only-sub', - action='store_true', dest='onlysubtitles', - help='downloads only the subtitles (no video)', default=False) + action='store_true', dest='skip_download', + help='[deprecated] alias of --skip-download', default=False) video_format.add_option('--all-subs', action='store_true', dest='allsubtitles', help='downloads all the available subtitles of the video (currently youtube only)', default=False) @@ -532,7 +532,6 @@ def _real_main(argv=None): 'writeinfojson': opts.writeinfojson, 'writethumbnail': opts.writethumbnail, 'writesubtitles': opts.writesubtitles, - 'onlysubtitles': opts.onlysubtitles, 'allsubtitles': opts.allsubtitles, 'listsubtitles': opts.listsubtitles, 'subtitlesformat': opts.subtitlesformat, |