- req = compat_urllib_request.Request(url)
- # Older versions of Firefox get redirected to an "upgrade browser" page
- req.add_header('User-Agent', 'youtube-dl')
- webpage = self._download_webpage(req, display_id)
- thumbnail = self._og_search_thumbnail(webpage)
- video_id = self._search_regex(r'/(\d+)\.png', thumbnail, 'id')
-
- if '<div class=\'vr-player jp-jplayer\'' in webpage:
- formats = [{
- 'url': 'https://voicerepublic.com/vrmedia/{}-clean.{}'.format(video_id, ext),
- 'ext': ext,
- 'format_id': ext,
- 'vcodec': 'none',
- } for ext in ['m4a', 'mp3', 'ogg']]
- self._sort_formats(formats)
- else:
- # Audio is still queued for processing
- formats = []
+
+ webpage = self._download_webpage(url, display_id)
+
+ if '>Queued for processing, please stand by...<' in webpage:
+ raise ExtractorError(
+ 'Audio is still queued for processing', expected=True)
+
+ talk = self._parse_json(self._search_regex(
+ r'initialSnapshot\s*=\s*({.+?});',
+ webpage, 'talk'), display_id)['talk']
+ title = talk['title']
+ formats = [{
+ 'url': urljoin(url, talk_url),
+ 'format_id': format_id,
+ 'ext': determine_ext(talk_url) or format_id,
+ 'vcodec': 'none',
+ } for format_id, talk_url in talk['media_links'].items()]
+ self._sort_formats(formats)