mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-22 06:00:00 +00:00
parent
6020e05d23
commit
9c906919ae
2 changed files with 4 additions and 0 deletions
|
@ -1160,6 +1160,7 @@ # OUTPUT TEMPLATE
|
|||
- `extractor_key` (string): Key name of the extractor
|
||||
- `epoch` (numeric): Unix epoch when creating the file
|
||||
- `autonumber` (numeric): Number that will be increased with each download, starting at `--autonumber-start`
|
||||
- `video_autonumber` (numeric): Number that will be increased with each video
|
||||
- `n_entries` (numeric): Total number of extracted items in the playlist
|
||||
- `playlist` (string): Name or id of the playlist that contains the video
|
||||
- `playlist_index` (numeric): Index of the video in the playlist padded with leading zeros according the final index
|
||||
|
|
|
@ -534,6 +534,7 @@ def __init__(self, params=None, auto_init=True):
|
|||
self._postprocessor_hooks = []
|
||||
self._download_retcode = 0
|
||||
self._num_downloads = 0
|
||||
self._num_videos = 0
|
||||
self._screen_file = [sys.stdout, sys.stderr][params.get('logtostderr', False)]
|
||||
self._err_file = sys.stderr
|
||||
self.params = params
|
||||
|
@ -1044,6 +1045,7 @@ def prepare_outtmpl(self, outtmpl, info_dict, sanitize=False):
|
|||
if info_dict.get('duration', None) is not None
|
||||
else None)
|
||||
info_dict['autonumber'] = self.params.get('autonumber_start', 1) - 1 + self._num_downloads
|
||||
info_dict['video_autonumber'] = self._num_videos
|
||||
if info_dict.get('resolution') is None:
|
||||
info_dict['resolution'] = self.format_resolution(info_dict, default=None)
|
||||
|
||||
|
@ -2275,6 +2277,7 @@ def check_thumbnails(thumbnails):
|
|||
|
||||
def process_video_result(self, info_dict, download=True):
|
||||
assert info_dict.get('_type', 'video') == 'video'
|
||||
self._num_videos += 1
|
||||
|
||||
if 'id' not in info_dict:
|
||||
raise ExtractorError('Missing "id" field in extractor result')
|
||||
|
|
Loading…
Reference in a new issue