mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	Add option --download-sections to download video partially
				
					
				
			Closes #52, Closes #3932
This commit is contained in:
		| @@ -916,6 +916,14 @@ def create_parser(): | ||||
|         help=( | ||||
|             'Do not use the mpegts container for HLS videos. ' | ||||
|             'This is default when not downloading live streams')) | ||||
|     downloader.add_option( | ||||
|         '--download-sections', | ||||
|         metavar='REGEX', dest='download_ranges', action='append', | ||||
|         help=( | ||||
|             'Download only chapters whose title matches the given regular expression. ' | ||||
|             'Time ranges prefixed by a "*" can also be used in place of chapters to download the specified range. ' | ||||
|             'Eg: --download-sections "*10:15-15:00" --download-sections "intro". ' | ||||
|             'Needs ffmpeg. This option can be used multiple times to download multiple sections')) | ||||
|     downloader.add_option( | ||||
|         '--downloader', '--external-downloader', | ||||
|         dest='external_downloader', metavar='[PROTO:]NAME', default={}, type='str', | ||||
| @@ -1631,9 +1639,7 @@ def create_parser(): | ||||
|         metavar='REGEX', dest='remove_chapters', action='append', | ||||
|         help=( | ||||
|             'Remove chapters whose title matches the given regular expression. ' | ||||
|             'Time ranges prefixed by a "*" can also be used in place of chapters to remove the specified range. ' | ||||
|             'Eg: --remove-chapters "*10:15-15:00" --remove-chapters "intro". ' | ||||
|             'This option can be used multiple times')) | ||||
|             'The syntax is the same as --download-sections. This option can be used multiple times')) | ||||
|     postproc.add_option( | ||||
|         '--no-remove-chapters', dest='remove_chapters', action='store_const', const=None, | ||||
|         help='Do not remove any chapters from the file (default)') | ||||
| @@ -1641,9 +1647,8 @@ def create_parser(): | ||||
|         '--force-keyframes-at-cuts', | ||||
|         action='store_true', dest='force_keyframes_at_cuts', default=False, | ||||
|         help=( | ||||
|             'Force keyframes around chapters when removing/splitting them. ' | ||||
|             'This is slow due to needing a re-encode, but ' | ||||
|             'the resulting video may have fewer artifacts around the cuts')) | ||||
|             'Force keyframes at cuts when downloading/splitting/removing sections. ' | ||||
|             'This is slow due to needing a re-encode, but the resulting video may have fewer artifacts around the cuts')) | ||||
|     postproc.add_option( | ||||
|         '--no-force-keyframes-at-cuts', | ||||
|         action='store_false', dest='force_keyframes_at_cuts', | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan