[BACKEND] Replicate yt-dlp postprocessor flags better for sponsorblock
This commit is contained in:
parent
2deafc9f2d
commit
fa4ab6075b
1 changed files with 15 additions and 1 deletions
|
|
@ -235,7 +235,7 @@ class ChaptersPlugin(Plugin[ChaptersOptions]):
|
|||
"postprocessors": [
|
||||
{
|
||||
"key": "SponsorBlock",
|
||||
"when": "pre_process",
|
||||
"when": "after_filter",
|
||||
"categories": self.plugin_options.sponsorblock_categories,
|
||||
},
|
||||
{"key": "ModifyChapters"},
|
||||
|
|
@ -280,6 +280,20 @@ class ChaptersPlugin(Plugin[ChaptersOptions]):
|
|||
}
|
||||
)
|
||||
|
||||
# Add this to the end to fully replicate sponsorblock chapter removal in yt-dlp
|
||||
# reference: yt-dlp/devscripts/cli_to_api.py --sponsorblock-remove all --embed-chapters
|
||||
if self._is_removing_chapters:
|
||||
builder.add(
|
||||
{
|
||||
"postprocessors": [
|
||||
{'key': 'FFmpegConcat',
|
||||
'only_multi_video': True,
|
||||
'when': 'playlist'}
|
||||
]
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
return builder.to_dict()
|
||||
|
||||
def _get_removed_chapters(self, entry: Entry) -> List[str]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue