yt-dlp/yt_dlp/postprocessor/__init__.py

64 lines
1.7 KiB
Python
Raw Normal View History

# flake8: noqa: F401
2021-11-09 23:44:42 +01:00
from .common import PostProcessor
from .embedthumbnail import EmbedThumbnailPP
from .exec import ExecAfterDownloadPP, ExecPP
from .ffmpeg import (
FFmpegConcatPP,
FFmpegCopyStreamPP,
FFmpegEmbedSubtitlePP,
FFmpegExtractAudioPP,
FFmpegFixupDuplicateMoovPP,
FFmpegFixupDurationPP,
FFmpegFixupM3u8PP,
FFmpegFixupM4aPP,
FFmpegFixupStretchedPP,
FFmpegFixupTimestampPP,
FFmpegMergerPP,
FFmpegMetadataPP,
FFmpegPostProcessor,
FFmpegSplitChaptersPP,
FFmpegSubtitlesConvertorPP,
FFmpegThumbnailsConvertorPP,
2021-04-11 02:22:55 +02:00
FFmpegVideoConvertorPP,
FFmpegVideoRemuxerPP,
2013-10-15 02:07:26 +02:00
)
2021-08-09 21:52:55 +02:00
from .metadataparser import (
MetadataFromFieldPP,
MetadataFromTitlePP,
MetadataParserPP,
)
from .modify_chapters import ModifyChaptersPP
from .movefilesafterdownload import MoveFilesAfterDownloadPP
2020-11-15 01:28:41 +01:00
from .sponskrub import SponSkrubPP
from .sponsorblock import SponsorBlockPP
from .xattrpp import XAttrMetadataPP
2023-01-07 08:19:13 +01:00
from ..globals import plugin_pps, postprocessors
from ..plugins import PACKAGE_NAME
from ..utils import deprecation_warning
2023-01-07 08:19:13 +01:00
def __getattr__(name):
lookup = plugin_pps.get()
if name in lookup:
deprecation_warning(
f'Importing a plugin Post-Processor from {__name__} is deprecated. '
f'Please import {PACKAGE_NAME}.postprocessor.{name} instead.')
return lookup[name]
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
def get_postprocessor(key):
2023-01-07 08:19:13 +01:00
return postprocessors.get()[key + 'PP']
2023-01-07 08:19:13 +01:00
_default_pps = {
name: value
for name, value in globals().items()
if name.endswith('PP') or name in ('PostProcessor', 'FFmpegPostProcessor')
}
postprocessors.set(_default_pps)
2023-01-07 08:19:13 +01:00
__all__ = list(_default_pps.values())