diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-12-15 01:06:25 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-12-15 01:06:25 +0100 |
commit | 4f026fafbc6cc4eac10a5f89b9375b44d64083c9 (patch) | |
tree | 866c1bfbbcda650b403df3eabff12ddb50f786dd /youtube_dl/postprocessor | |
parent | 39f594d660cd86f04905d3eead91c5e2f16b0e66 (diff) |
[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.
Diffstat (limited to 'youtube_dl/postprocessor')
-rw-r--r-- | youtube_dl/postprocessor/__init__.py | 9 | ||||
-rw-r--r-- | youtube_dl/postprocessor/ffmpeg.py | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/youtube_dl/postprocessor/__init__.py b/youtube_dl/postprocessor/__init__.py index fb367ebe4..7f505b58e 100644 --- a/youtube_dl/postprocessor/__init__.py +++ b/youtube_dl/postprocessor/__init__.py @@ -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', ] diff --git a/youtube_dl/postprocessor/ffmpeg.py b/youtube_dl/postprocessor/ffmpeg.py index 965ded4c1..048525efc 100644 --- a/youtube_dl/postprocessor/ffmpeg.py +++ b/youtube_dl/postprocessor/ffmpeg.py @@ -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): |