aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_ytdl.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_ytdl.py')
-rw-r--r--test/test_ytdl.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/test_ytdl.py b/test/test_ytdl.py
index eedb4f9..a273604 100644
--- a/test/test_ytdl.py
+++ b/test/test_ytdl.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-# Copyright 2022 Mike Fährmann
+# Copyright 2022-2023 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -262,11 +262,21 @@ class Test_CommandlineArguments_YtDlp(Test_CommandlineArguments):
def test_metadata_from_title(self):
opts = self._(["--metadata-from-title", "%(artist)s - %(title)s"])
+
+ try:
+ legacy = (self.module.version.__version__ < "2023.01.01")
+ except AttributeError:
+ legacy = True
+
+ actions = [self.module.MetadataFromFieldPP.to_action(
+ "title:%(artist)s - %(title)s")]
+ if not legacy:
+ actions = {"pre_process": actions}
+
self.assertEqual(opts["postprocessors"][0], {
- "key": "MetadataParser",
- "when": "pre_process",
- "actions": [self.module.MetadataFromFieldPP.to_action(
- "title:%(artist)s - %(title)s")],
+ "key" : "MetadataParser",
+ "when" : "pre_process",
+ "actions": actions,
})