[YoutubeDL] Make postprocessors declarative
Instead of having to configure PPs in code, this allows us and embedding programs not to worry about imports or finer details, similarly to how we handle IEs.
This commit is contained in:
@ -8,11 +8,16 @@ from .ffmpeg import (
|
||||
FFmpegExtractAudioPP,
|
||||
FFmpegMergerPP,
|
||||
FFmpegMetadataPP,
|
||||
FFmpegVideoConvertor,
|
||||
FFmpegVideoConvertorPP,
|
||||
)
|
||||
from .xattrpp import XAttrMetadataPP
|
||||
from .execafterdownload import ExecAfterDownloadPP
|
||||
|
||||
|
||||
def get_postprocessor(key):
|
||||
return globals()[key + 'PP']
|
||||
|
||||
|
||||
__all__ = [
|
||||
'AtomicParsleyPP',
|
||||
'ExecAfterDownloadPP',
|
||||
@ -22,6 +27,6 @@ __all__ = [
|
||||
'FFmpegMergerPP',
|
||||
'FFmpegMetadataPP',
|
||||
'FFmpegPostProcessor',
|
||||
'FFmpegVideoConvertor',
|
||||
'FFmpegVideoConvertorPP',
|
||||
'XAttrMetadataPP',
|
||||
]
|
||||
|
@ -236,9 +236,9 @@ class FFmpegExtractAudioPP(FFmpegPostProcessor):
|
||||
return self._nopostoverwrites, information
|
||||
|
||||
|
||||
class FFmpegVideoConvertor(FFmpegPostProcessor):
|
||||
class FFmpegVideoConvertorPP(FFmpegPostProcessor):
|
||||
def __init__(self, downloader=None, preferedformat=None):
|
||||
super(FFmpegVideoConvertor, self).__init__(downloader)
|
||||
super(FFmpegVideoConvertorPP, self).__init__(downloader)
|
||||
self._preferedformat = preferedformat
|
||||
|
||||
def run(self, information):
|
||||
|
Reference in New Issue
Block a user