From b70703b7a7af8a63445aa6c1d664994cb0cb9e52 Mon Sep 17 00:00:00 2001 From: meeb Date: Fri, 24 Sep 2021 12:30:59 +1000 Subject: [PATCH] patch youtube-dl-info command to work with yt-dlp metadata --- tubesync/sync/management/commands/youtube-dl-info.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tubesync/sync/management/commands/youtube-dl-info.py b/tubesync/sync/management/commands/youtube-dl-info.py index 310b10d..32a4740 100644 --- a/tubesync/sync/management/commands/youtube-dl-info.py +++ b/tubesync/sync/management/commands/youtube-dl-info.py @@ -1,6 +1,7 @@ import json from django.core.management.base import BaseCommand, CommandError from sync.youtube import get_media_info +from common.utils import json_serial class Command(BaseCommand): @@ -14,5 +15,6 @@ class Command(BaseCommand): url = options['url'] self.stdout.write(f'Showing information for URL: {url}') info = get_media_info(url) - self.stdout.write(json.dumps(info, indent=4, sort_keys=True)) + d = json.dumps(info, indent=4, sort_keys=True, default=json_serial) + self.stdout.write(d) self.stdout.write('Done')