-# coding: utf-8
-from __future__ import unicode_literals
-
import re
from .common import InfoExtractor
-
from ..utils import (
determine_ext,
float_or_none,
webpage, 'media id', group='id')
data = self._download_json(
- 'https://media.loc.gov/services/v1/media?id=%s&context=json' % media_id,
+ f'https://media.loc.gov/services/v1/media?id={media_id}&context=json',
media_id)['mediaObject']
derivative = data['derivatives'][0]
'filesize_approx': parse_filesize(m.group('size')),
})
- self._sort_formats(formats)
-
duration = float_or_none(data.get('duration'))
view_count = int_or_none(data.get('viewCount'))