A feature-rich command-line audio/video downloader
Add field `video_autonumber`
pukkandan9c906919aed2
diff --git a/README.md b/README.mdindex f236ced157..ef79afb54c 100644--- a/README.md+++ b/README.md@@ -1160,6 +1160,7 @@ The available fields are:- `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 indexdiff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.pyindex d027e342e2..40ce22d6d4 100644--- a/yt_dlp/YoutubeDL.py+++ b/yt_dlp/YoutubeDL.py@@ -534,6 +534,7 @@ class YoutubeDL(object):self._postprocessor_hooks = []self._download_retcode = 0self._num_downloads = 0+ self._num_videos = 0self._screen_file = [sys.stdout, sys.stderr][params.get('logtostderr', False)]self._err_file = sys.stderrself.params = params@@ -1044,6 +1045,7 @@ class YoutubeDL(object):if info_dict.get('duration', None) is not Noneelse None)info_dict['autonumber'] = self.params.get('autonumber_start', 1) - 1 + self._num_downloads+ info_dict['video_autonumber'] = self._num_videosif info_dict.get('resolution') is None:info_dict['resolution'] = self.format_resolution(info_dict, default=None)@@ -2275,6 +2277,7 @@ class YoutubeDL(object):def process_video_result(self, info_dict, download=True):assert info_dict.get('_type', 'video') == 'video'+ self._num_videos += 1if 'id' not in info_dict:raise ExtractorError('Missing "id" field in extractor result')