diff options
author | Nil Admirari <50202386+nihil-admirari@users.noreply.github.com> | 2022-02-22 14:18:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 06:18:44 -0800 |
commit | 7a34b5d628ad3b92a14ee7f51daa1cab9e326615 (patch) | |
tree | ac63a90ab4185ff37f8b0f1fddfb45a74a749059 | |
parent | 4d4f9a029f8aebd06bcd98ca61e7629de47e0018 (diff) | |
download | hypervideo-pre-7a34b5d628ad3b92a14ee7f51daa1cab9e326615.tar.lz hypervideo-pre-7a34b5d628ad3b92a14ee7f51daa1cab9e326615.tar.xz hypervideo-pre-7a34b5d628ad3b92a14ee7f51daa1cab9e326615.zip |
[SponsorBlock] Fixes for highlight and "full video labels" (#2849)
Authored by: nihil-admirari
-rw-r--r-- | yt_dlp/postprocessor/sponsorblock.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/yt_dlp/postprocessor/sponsorblock.py b/yt_dlp/postprocessor/sponsorblock.py index cd48b15ae..e7e04e86e 100644 --- a/yt_dlp/postprocessor/sponsorblock.py +++ b/yt_dlp/postprocessor/sponsorblock.py @@ -49,6 +49,9 @@ class SponsorBlockPP(FFmpegPostProcessor): def duration_filter(s): start_end = s['segment'] + # Ignore entire video segments (https://wiki.sponsor.ajay.app/w/Types). + if start_end == (0, 0): + return False # Ignore milliseconds difference at the start. if start_end[0] <= 1: start_end[0] = 0 @@ -89,6 +92,7 @@ class SponsorBlockPP(FFmpegPostProcessor): url = f'{self._API_URL}/api/skipSegments/{hash[:4]}?' + compat_urllib_parse_urlencode({ 'service': service, 'categories': json.dumps(self._categories), + 'actionTypes': json.dumps(['skip', 'poi']) }) self.write_debug(f'SponsorBlock query: {url}') for d in self._get_json(url): |