[ytdl} fix dfe4f00c for legacy yt-dlp
This commit is contained in:
@@ -262,15 +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": {
|
||||
"pre_process": [
|
||||
self.module.MetadataFromFieldPP.to_action(
|
||||
"title:%(artist)s - %(title)s")
|
||||
],
|
||||
},
|
||||
"actions": actions,
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user