patch youtube-dl-info command to work with yt-dlp metadata

This commit is contained in:
meeb 2021-09-24 12:30:59 +10:00
parent 6ac0c6e9de
commit b70703b7a7
1 changed files with 3 additions and 1 deletions

View File

@ -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')