2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class VoiceRepublicIE(InfoExtractor):
12 _VALID_URL = r'https?://voicerepublic\.com/talks/(?P<id>[0-9a-z-]+)'
14 'url': 'https://voicerepublic.com/talks/watching-the-watchers-building-a-sousveillance-state',
15 'md5': '0554a24d1657915aa8e8f84e15dc9353',
19 'title': 'Watching the Watchers: Building a Sousveillance State',
20 'thumbnail': 'https://voicerepublic.com/system/flyer/2296.png',
21 'description': 'md5:715ba964958afa2398df615809cfecb1',
22 'creator': 'M. C. McGrath',
26 def _real_extract(self, url):
27 display_id = self._match_id(url)
28 req = compat_urllib_request.Request(url)
29 # Older versions of Firefox get redirected to an "upgrade browser" page
30 req.add_header('User-Agent', 'youtube-dl')
31 webpage = self._download_webpage(req, display_id)
32 thumbnail = self._og_search_thumbnail(webpage)
33 video_id = self._search_regex(r'/(\d+)\.png', thumbnail, 'id')
35 if '<div class=\'vr-player jp-jplayer\'' in webpage:
37 'url': 'https://voicerepublic.com/vrmedia/{}-clean.{}'.format(video_id, ext),
41 } for ext in ['m4a', 'mp3', 'ogg']]
42 self._sort_formats(formats)
44 # Audio is still queued for processing
49 'title': self._og_search_title(webpage),
51 'url': self._og_search_url(webpage),
52 'thumbnail': thumbnail,
53 'description': self._og_search_description(webpage),
54 'creator': self._html_search_meta('author', webpage),