1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-09 08:53:22 +08:00

[libsyn] fix extracting the release date

The "Released:" text was removed from the page
but the release_date JSON data field has the same info.
This commit is contained in:
Paul Wise 2019-01-08 10:16:58 +08:00
parent bd3851b9dd
commit 6aa12bf34c
No known key found for this signature in database
GPG Key ID: 3116BA5E9FFA69A3

View File

@ -60,8 +60,6 @@ class LibsynIE(InfoExtractor):
if description:
# Strip non-breaking and normal spaces
description = description.replace('\u00A0', ' ').strip()
release_date = unified_strdate(self._search_regex(
r'<div class="release_date">Released: ([^<]+)<', webpage, 'release date', fatal=False))
data_json = self._search_regex(r'var\s+playlistItem\s*=\s*(\{.*?\});\n', webpage, 'JSON data block')
data = json.loads(data_json)
@ -75,6 +73,7 @@ class LibsynIE(InfoExtractor):
}]
thumbnail = data.get('thumbnail_url')
duration = parse_duration(data.get('duration'))
release_date = unified_strdate(data['release_date'])
return {
'id': video_id,