aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-10-18 23:08:23 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-10-18 23:08:23 +0530
commit1338ae3ba338d116ab75d787cc6d637d382d0f77 (patch)
treed57243bdc952582251ce11d43e99ee1d0d5374fe
parent63c547d71ceae6be181948b4b6ce4180b16f4209 (diff)
downloadhypervideo-pre-1338ae3ba338d116ab75d787cc6d637d382d0f77.tar.lz
hypervideo-pre-1338ae3ba338d116ab75d787cc6d637d382d0f77.tar.xz
hypervideo-pre-1338ae3ba338d116ab75d787cc6d637d382d0f77.zip
[SponsorBlock] Add `type` field
-rw-r--r--README.md3
-rw-r--r--yt_dlp/postprocessor/sponsorblock.py1
2 files changed, 3 insertions, 1 deletions
diff --git a/README.md b/README.md
index e7fc6886a..589000456 100644
--- a/README.md
+++ b/README.md
@@ -1311,10 +1311,11 @@ Available only in `--sponsorblock-chapter-title`:
- `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.
diff --git a/yt_dlp/postprocessor/sponsorblock.py b/yt_dlp/postprocessor/sponsorblock.py
index befff0e1f..bb15eb709 100644
--- a/yt_dlp/postprocessor/sponsorblock.py
+++ b/yt_dlp/postprocessor/sponsorblock.py
@@ -78,6 +78,7 @@ class SponsorBlockPP(FFmpegPostProcessor):
'end_time': end,
'category': cat,
'title': title,
+ 'type': s['actionType'],
'_categories': [(cat, start, end, title)],
}