diff options
author | Sergey M․ <dstftw@gmail.com> | 2018-04-08 00:08:45 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2018-04-08 00:08:45 +0700 |
commit | 1c9b1a449430bd8b267c9c43ce7ed7cb73ac4433 (patch) | |
tree | 66e52c5f7a126761ac723d76bb30eb9f7d1bc9bc /youtube_dl | |
parent | ff826177cc154ba8c67b8162a25e067783dc4caa (diff) |
[acast] Fix extraction (closes #16118)
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/acast.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/youtube_dl/extractor/acast.py b/youtube_dl/extractor/acast.py index 5871e72dc..4ad549c92 100644 --- a/youtube_dl/extractor/acast.py +++ b/youtube_dl/extractor/acast.py @@ -7,7 +7,7 @@ import functools from .common import InfoExtractor from ..compat import compat_str from ..utils import ( - int_or_none, + float_or_none, unified_timestamp, OnDemandPagedList, ) @@ -46,18 +46,22 @@ class ACastIE(InfoExtractor): def _real_extract(self, url): channel, display_id = re.match(self._VALID_URL, url).groups() + s = self._download_json( + 'https://play-api.acast.com/stitch/%s/%s' % (channel, display_id), + display_id)['result'] + media_url = s['url'] cast_data = self._download_json( 'https://play-api.acast.com/splash/%s/%s' % (channel, display_id), display_id) e = cast_data['result']['episode'] return { 'id': compat_str(e['id']), 'display_id': display_id, - 'url': e['mediaUrl'], + 'url': media_url, 'title': e['name'], 'description': e.get('description'), 'thumbnail': e.get('image'), 'timestamp': unified_timestamp(e.get('publishingDate')), - 'duration': int_or_none(e.get('duration')), + 'duration': float_or_none(s.get('duration') or e.get('duration')), } |