temporarily disable sponsorblock by default pending #338

This commit is contained in:
meeb 2023-02-18 12:54:39 +11:00
parent e75b446883
commit 35678e3be9
1 changed files with 12 additions and 9 deletions

View File

@ -100,7 +100,17 @@ def download_media(url, media_format, extension, output_file, info_json, sponsor
else: else:
log.warn(f'[youtube-dl] unknown event: {str(event)}') log.warn(f'[youtube-dl] unknown event: {str(event)}')
hook.download_progress = 0 hook.download_progress = 0
postprocessors = []
postprocessors.append({
'key': 'FFmpegMetadata',
'add_chapters': True,
'add_metadata': True
})
# Pending configuration options from PR #338
#postprocessors.append({
# 'key': 'SponsorBlock',
# 'categories': [sponsor_categories]
#})
opts = get_yt_opts() opts = get_yt_opts()
opts.update({ opts.update({
'format': media_format, 'format': media_format,
@ -109,14 +119,7 @@ def download_media(url, media_format, extension, output_file, info_json, sponsor
'quiet': True, 'quiet': True,
'progress_hooks': [hook], 'progress_hooks': [hook],
'writeinfojson': info_json, 'writeinfojson': info_json,
'postprocessors': [{ 'postprocessors': postprocessors,
'key': 'SponsorBlock',
'categories': [sponsor_categories]
},{
'key': 'FFmpegMetadata',
'add_chapters': True,
'add_metadata': True
}]
}) })
with yt_dlp.YoutubeDL(opts) as y: with yt_dlp.YoutubeDL(opts) as y:
try: try: