2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..compat import compat_urllib_request
6 from ..utils import ExtractorError
9 class VoiceRepublicIE(InfoExtractor):
10 _VALID_URL = r'https?://voicerepublic\.com/talks/(?P<id>[0-9a-z-]+)'
12 'url': 'https://voicerepublic.com/talks/watching-the-watchers-building-a-sousveillance-state',
13 'md5': '0554a24d1657915aa8e8f84e15dc9353',
17 'title': 'Watching the Watchers: Building a Sousveillance State',
18 'thumbnail': 'https://voicerepublic.com/system/flyer/2296.png',
19 'description': 'md5:715ba964958afa2398df615809cfecb1',
23 def _real_extract(self, url):
24 display_id = self._match_id(url)
25 req = compat_urllib_request.Request(url)
26 # Older versions of Firefox get redirected to an "upgrade browser" page
27 req.add_header('User-Agent', 'youtube-dl')
28 webpage = self._download_webpage(req, display_id)
29 thumbnail = self._og_search_thumbnail(webpage)
30 video_id = self._search_regex(r'/(\d+)\.png', thumbnail, 'id')
32 if '<a>Queued for processing, please stand by...</a>' in webpage:
33 raise ExtractorError('Audio is still queued for processing')
36 'url': 'https://voicerepublic.com/vrmedia/{}-clean.{}'.format(video_id, ext),
40 } for ext in ['m4a', 'mp3', 'ogg']]
41 self._sort_formats(formats)
45 'title': self._og_search_title(webpage),
47 'url': self._og_search_url(webpage),
48 'thumbnail': thumbnail,
49 'description': self._og_search_description(webpage),