]> jfr.im git - yt-dlp.git/commitdiff
[SponsorBlock] Add `type` field
authorpukkandan <redacted>
Tue, 18 Oct 2022 17:38:23 +0000 (23:08 +0530)
committerpukkandan <redacted>
Tue, 18 Oct 2022 17:38:23 +0000 (23:08 +0530)
README.md
yt_dlp/postprocessor/sponsorblock.py

index e7fc6886a4a79610d5d12c0aa3bf8c3e1731f34a..5890004565b0050d292ffbde0f7f250a0348c86c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1311,10 +1311,11 @@ # OUTPUT TEMPLATE
 
  - `start_time` (numeric): Start time of the chapter in seconds
  - `end_time` (numeric): End time of the chapter in seconds
- - `categories` (list): The SponsorBlock categories the chapter belongs to
+ - `categories` (list): The [SponsorBlock categories](https://wiki.sponsor.ajay.app/w/Types#Category) the chapter belongs to
  - `category` (string): The smallest SponsorBlock category the chapter belongs to
  - `category_names` (list): Friendly names of the categories
  - `name` (string): Friendly name of the smallest category
+ - `type` (string): The [SponsorBlock action type](https://wiki.sponsor.ajay.app/w/Types#Action_Type) of the chapter
 
 Each aforementioned sequence when referenced in an output template will be replaced by the actual value corresponding to the sequence name. E.g. for `-o %(title)s-%(id)s.%(ext)s` and an mp4 video with title `yt-dlp test video` and id `BaW_jenozKc`, this will result in a `yt-dlp test video-BaW_jenozKc.mp4` file created in the current directory.
 
index befff0e1f2b61abc0643d158838e67fbf8828db3..bb15eb7096ff58097cdd722d99f18e3c766199e3 100644 (file)
@@ -78,6 +78,7 @@ def to_chapter(s):
                 'end_time': end,
                 'category': cat,
                 'title': title,
+                'type': s['actionType'],
                 '_categories': [(cat, start, end, title)],
             }