1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 16:45:17 +00:00
Closes #3472
This commit is contained in:
pukkandan
2022-04-19 02:57:20 +05:30
parent 43cc91ad75
commit 1e9969f4f5
4 changed files with 7 additions and 9 deletions

View File

@ -6,12 +6,12 @@ from ..utils import Namespace
class MetadataParserPP(PostProcessor):
def __init__(self, downloader, actions):
super().__init__(self, downloader)
super().__init__(downloader)
self._actions = []
for f in actions:
action, *args = f
assert action in self.Actions
self._actions.append(action(*args))
self._actions.append(action(self, *args))
@classmethod
def validate_action(cls, action, *data):
@ -21,7 +21,7 @@ class MetadataParserPP(PostProcessor):
"""
if action not in cls.Actions:
raise ValueError(f'{action!r} is not a valid action')
getattr(cls, action.value)(cls, *data) # So this can raise error to validate
action(cls, *data) # So this can raise error to validate
@staticmethod
def field_to_template(tmpl):