Add option for AAC -> MP3 conversion post-processor

This commit is contained in:
Connor Mason 2025-02-09 11:08:57 -08:00
parent 6e22b3b1eb
commit 07cad2dbeb
3 changed files with 11 additions and 0 deletions

View file

@ -287,6 +287,10 @@ def _real_main(argv=None):
postprocessors.append({ postprocessors.append({
'key': 'FFmpegEmbedSubtitle', 'key': 'FFmpegEmbedSubtitle',
}) })
if opts.aacToMp3:
postprocessors.append({
'key': 'ConvertAACToMP3PP',
})
if opts.embedthumbnail: if opts.embedthumbnail:
already_have_thumbnail = opts.writethumbnail or opts.write_all_thumbnails already_have_thumbnail = opts.writethumbnail or opts.write_all_thumbnails
postprocessors.append({ postprocessors.append({

View file

@ -818,6 +818,11 @@ def parseOpts(overrideArguments=None):
'--no-post-overwrites', '--no-post-overwrites',
action='store_true', dest='nopostoverwrites', default=False, action='store_true', dest='nopostoverwrites', default=False,
help='Do not overwrite post-processed files; the post-processed files are overwritten by default') help='Do not overwrite post-processed files; the post-processed files are overwritten by default')
postproc.add_option(
'--aac-to-mp3',
action='store_true', dest='aacToMp3', default=False,
help='Convert AAC files to MP3',
)
postproc.add_option( postproc.add_option(
'--embed-subs', '--embed-subs',
action='store_true', dest='embedsubtitles', default=False, action='store_true', dest='embedsubtitles', default=False,

View file

@ -2,6 +2,7 @@ from __future__ import unicode_literals
from .embedthumbnail import EmbedThumbnailPP from .embedthumbnail import EmbedThumbnailPP
from .ffmpeg import ( from .ffmpeg import (
ConvertAACToMP3PP,
FFmpegPostProcessor, FFmpegPostProcessor,
FFmpegEmbedSubtitlePP, FFmpegEmbedSubtitlePP,
FFmpegExtractAudioPP, FFmpegExtractAudioPP,
@ -23,6 +24,7 @@ def get_postprocessor(key):
__all__ = [ __all__ = [
'ConvertAACToMP3PP',
'EmbedThumbnailPP', 'EmbedThumbnailPP',
'ExecAfterDownloadPP', 'ExecAfterDownloadPP',
'FFmpegEmbedSubtitlePP', 'FFmpegEmbedSubtitlePP',