diff options
author | Nil Admirari <50202386+nihil-admirari@users.noreply.github.com> | 2021-12-09 12:40:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-09 18:10:31 +0530 |
commit | 8157a09d22f6f4310427a7155e737c2c1bc3aef9 (patch) | |
tree | 4318ae9bea7b276a89f91a1c0e143464ef225316 /yt_dlp/options.py | |
parent | b1aaf1c07fae6f6e5d4bc966016f5e5df7b6c83c (diff) | |
download | hypervideo-pre-8157a09d22f6f4310427a7155e737c2c1bc3aef9.tar.lz hypervideo-pre-8157a09d22f6f4310427a7155e737c2c1bc3aef9.tar.xz hypervideo-pre-8157a09d22f6f4310427a7155e737c2c1bc3aef9.zip |
[SponsorBlock] Add Filler and Highlight categories (#1664)
Authored by: nihil-admirari, pukkandan
Diffstat (limited to 'yt_dlp/options.py')
-rw-r--r-- | yt_dlp/options.py | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/yt_dlp/options.py b/yt_dlp/options.py index bb421e0f8..82088638b 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -1465,20 +1465,29 @@ def parseOpts(overrideArguments=None): sponsorblock.add_option( '--sponsorblock-mark', metavar='CATS', dest='sponsorblock_mark', default=set(), action='callback', type='str', - callback=_set_from_options_callback, callback_kwargs={'allowed_values': SponsorBlockPP.CATEGORIES.keys()}, - help=( + callback=_set_from_options_callback, callback_kwargs={ + 'allowed_values': SponsorBlockPP.CATEGORIES.keys(), + 'aliases': {'default': ['all']} + }, help=( 'SponsorBlock categories to create chapters for, separated by commas. ' - 'Available categories are all, %s. You can prefix the category with a "-" to exempt it. ' - 'See https://wiki.sponsor.ajay.app/index.php/Segment_Categories for description of the categories. ' - 'Eg: --sponsorblock-mark all,-preview' % ', '.join(SponsorBlockPP.CATEGORIES.keys()))) + f'Available categories are all, default(=all), {", ".join(SponsorBlockPP.CATEGORIES.keys())}. ' + 'You can prefix the category with a "-" to exempt it. See [1] for description of the categories. ' + 'Eg: --sponsorblock-mark all,-preview [1] https://wiki.sponsor.ajay.app/w/Segment_Categories')) sponsorblock.add_option( '--sponsorblock-remove', metavar='CATS', dest='sponsorblock_remove', default=set(), action='callback', type='str', - callback=_set_from_options_callback, callback_kwargs={'allowed_values': SponsorBlockPP.CATEGORIES.keys()}, - help=( + callback=_set_from_options_callback, callback_kwargs={ + 'allowed_values': set(SponsorBlockPP.CATEGORIES.keys()) - set(SponsorBlockPP.POI_CATEGORIES.keys()), + # Note: From https://wiki.sponsor.ajay.app/w/Types: + # The filler category is very aggressive. + # It is strongly recommended to not use this in a client by default. + 'aliases': {'default': ['all', '-filler']} + }, help=( 'SponsorBlock categories to be removed from the video file, separated by commas. ' 'If a category is present in both mark and remove, remove takes precedence. ' - 'The syntax and available categories are the same as for --sponsorblock-mark')) + 'The syntax and available categories are the same as for --sponsorblock-mark ' + 'except that "default" refers to "all,-filler" ' + f'and {", ".join(SponsorBlockPP.POI_CATEGORIES.keys())} is not available')) sponsorblock.add_option( '--sponsorblock-chapter-title', metavar='TEMPLATE', default=DEFAULT_SPONSORBLOCK_CHAPTER_TITLE, dest='sponsorblock_chapter_title', |