1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-13 18:27:18 +08:00

[LibraryOfCongress] Improvements

This commit is contained in:
TRox1972 2016-05-30 19:53:11 +02:00
parent bd5610b6a6
commit cafa56ebc7

View File

@ -31,7 +31,9 @@ class LibraryOfCongressIE(InfoExtractor):
self.report_extraction(video_id)
json_id = self._search_regex('media-player-([0-9A-Z]{32})', webpage, 'json id')
data = self._parse_json(self._download_webpage('https://media.loc.gov/services/v1/media?id=%s' % json_id, video_id), video_id)
data = self._parse_json(self._download_webpage(
'https://media.loc.gov/services/v1/media?id=%s' % json_id,
video_id), video_id)
data = data['mediaObject']
media_url = data['derivatives'][0]['derivativeUrl']
@ -59,6 +61,5 @@ class LibraryOfCongressIE(InfoExtractor):
'id': video_id,
'thumbnail': self._og_search_thumbnail(webpage),
'title': self._og_search_title(webpage),
'ext': 'mp4' if is_video else 'mp3',
'formats': formats,
}