diff options
author | Jesús <heckyel@hyperbola.info> | 2021-11-30 17:19:55 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-11-30 17:19:55 -0500 |
commit | ccf02e63e53e481824b56b4e05ab1c2a9558c9a7 (patch) | |
tree | 41ad503be3ca01b0d83d0585f577bcf871b3f159 /yt_dlp/postprocessor/metadataparser.py | |
parent | 54288332f1d8ec2974c65281e6a712e56b5cd24f (diff) | |
parent | 1bad50eced921126ea6587d9ae99e98164da500b (diff) | |
download | hypervideo-pre-ccf02e63e53e481824b56b4e05ab1c2a9558c9a7.tar.lz hypervideo-pre-ccf02e63e53e481824b56b4e05ab1c2a9558c9a7.tar.xz hypervideo-pre-ccf02e63e53e481824b56b4e05ab1c2a9558c9a7.zip |
updated from upstream | 30/11/2021 at 17:19
Diffstat (limited to 'yt_dlp/postprocessor/metadataparser.py')
-rw-r--r-- | yt_dlp/postprocessor/metadataparser.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/yt_dlp/postprocessor/metadataparser.py b/yt_dlp/postprocessor/metadataparser.py index 96aac9beb..54b2c5627 100644 --- a/yt_dlp/postprocessor/metadataparser.py +++ b/yt_dlp/postprocessor/metadataparser.py @@ -16,7 +16,7 @@ class MetadataParserPP(PostProcessor): for f in actions: action = f[0] assert isinstance(action, self.Actions) - self._actions.append(getattr(self, action._value_)(*f[1:])) + self._actions.append(getattr(self, action.value)(*f[1:])) @classmethod def validate_action(cls, action, *data): @@ -26,7 +26,7 @@ class MetadataParserPP(PostProcessor): ''' if not isinstance(action, cls.Actions): raise ValueError(f'{action!r} is not a valid action') - getattr(cls, action._value_)(cls, *data) + getattr(cls, action.value)(cls, *data) @staticmethod def field_to_template(tmpl): @@ -96,6 +96,7 @@ class MetadataParserPP(PostProcessor): return f +# Deprecated class MetadataFromFieldPP(MetadataParserPP): @classmethod def to_action(cls, f): @@ -108,9 +109,16 @@ class MetadataFromFieldPP(MetadataParserPP): match.group('out')) def __init__(self, downloader, formats): - MetadataParserPP.__init__(self, downloader, [self.to_action(f) for f in formats]) + super().__init__(self, downloader, [self.to_action(f) for f in formats]) + self.deprecation_warning( + 'yt_dlp.postprocessor.MetadataFromFieldPP is deprecated ' + 'and may be removed in a future version. Use yt_dlp.postprocessor.MetadataParserPP instead') -class MetadataFromTitlePP(MetadataParserPP): # for backward compatibility +# Deprecated +class MetadataFromTitlePP(MetadataParserPP): def __init__(self, downloader, titleformat): - MetadataParserPP.__init__(self, downloader, [(self.Actions.INTERPRET, 'title', titleformat)]) + super().__init__(self, downloader, [(self.Actions.INTERPRET, 'title', titleformat)]) + self.deprecation_warning( + 'yt_dlp.postprocessor.MetadataFromTitlePP is deprecated ' + 'and may be removed in a future version. Use yt_dlp.postprocessor.MetadataParserPP instead') |