From bc21c48aecb33648341f9ab0c89dce5afa7402c0 Mon Sep 17 00:00:00 2001 From: Katie Pratt Date: Sun, 6 Oct 2019 18:48:39 -0400 Subject: [PATCH] adding support for cli --- youtube_dl/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 9a659fc65..1251688b4 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -10,6 +10,7 @@ import io import os import random import sys +import json from .options import ( @@ -275,7 +276,11 @@ def _real_main(argv=None): # source and target containers. From this point the container won't change, # so metadata can be added here. if opts.addmetadata: - postprocessors.append({'key': 'FFmpegMetadata'}) + postprocessors.append({ + 'key': 'FFmpegMetadata', + 'preferredinfo': json.load(opts.preferredinfo), + }) + if opts.convertsubtitles: postprocessors.append({ 'key': 'FFmpegSubtitlesConvertor',