aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/options.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-03-15 04:32:13 +0530
committerGitHub <noreply@github.com>2021-03-15 04:32:13 +0530
commit7275535116d6b10c1e6df54c50ee872635f3c37e (patch)
tree95812b591ce8e471b4749d076cd155a48f5205de /yt_dlp/options.py
parenta1c5d2ca6419f199a856bc111ac63b76947768b3 (diff)
downloadhypervideo-pre-7275535116d6b10c1e6df54c50ee872635f3c37e.tar.lz
hypervideo-pre-7275535116d6b10c1e6df54c50ee872635f3c37e.tar.xz
hypervideo-pre-7275535116d6b10c1e6df54c50ee872635f3c37e.zip
Split video by chapters (#158)
* New options `--split-chapters` and `--no-split-chapters` * The output/path of the split files can be given using the key `chapter` * Additional keys `section_title`, `section_number`, `section_start`, `section_end` are available in the output template * Alias `--split-tracks` for parity with animelover/youtube-dl * `--sponskrub-cut` and `--split-chapter` cannot work together Closes: https://github.com/blackjack4494/yt-dlc/issues/277 https://github.com/ytdl-org/youtube-dl/issues/28438 https://github.com/ytdl-org/youtube-dl/issues/12907 https://github.com/ytdl-org/youtube-dl/issues/6480 https://github.com/ytdl-org/youtube-dl/pull/25005 Rewritten from the implementation by: femaref and Wattux https://github.com/Wattux/youtube-dl/tree/split-at-timestamps https://github.com/ytdl-org/youtube-dl/pull/25005 https://github.com/femaref/youtube-dl/tree/split-track
Diffstat (limited to 'yt_dlp/options.py')
-rw-r--r--yt_dlp/options.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/yt_dlp/options.py b/yt_dlp/options.py
index 1e995b490..99b7db184 100644
--- a/yt_dlp/options.py
+++ b/yt_dlp/options.py
@@ -1183,6 +1183,17 @@ def parseOpts(overrideArguments=None):
'--convert-subs', '--convert-subtitles',
metavar='FORMAT', dest='convertsubtitles', default=None,
help='Convert the subtitles to other format (currently supported: srt|ass|vtt|lrc)')
+ postproc.add_option(
+ '--split-chapters', '--split-tracks',
+ dest='split_chapters', action='store_true', default=False,
+ help=(
+ 'Split video into multiple files based on internal chapters. '
+ 'The "chapter:" prefix can be used with "--paths" and "--output" to '
+ 'set the output filename for the split files. See "OUTPUT TEMPLATE" for details'))
+ postproc.add_option(
+ '--no-split-chapters', '--no-split-tracks',
+ dest='split_chapters', action='store_false',
+ help='Do not split video based on chapters (default)')
sponskrub = optparse.OptionGroup(parser, 'SponSkrub (SponsorBlock) Options', description=(
'SponSkrub (https://github.com/yt-dlp/SponSkrub) is a utility to mark/remove sponsor segments '