]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/voicerepublic.py
1 from . common
import InfoExtractor
2 from .. compat
import compat_str
11 class VoiceRepublicIE ( InfoExtractor
):
12 _VALID_URL
= r
'https?://voicerepublic\.com/(?:talks|embed)/(?P<id>[0-9a-z-]+)'
14 'url' : 'http://voicerepublic.com/talks/watching-the-watchers-building-a-sousveillance-state' ,
15 'md5' : 'b9174d651323f17783000876347116e3' ,
18 'display_id' : 'watching-the-watchers-building-a-sousveillance-state' ,
20 'title' : 'Watching the Watchers: Building a Sousveillance State' ,
21 'description' : 'Secret surveillance programs have metadata too. The people and companies that operate secret surveillance programs can be surveilled.' ,
26 'url' : 'http://voicerepublic.com/embed/watching-the-watchers-building-a-sousveillance-state' ,
27 'only_matching' : True ,
30 def _real_extract ( self
, url
):
31 display_id
= self
._ match
_ id
( url
)
33 webpage
= self
._ download
_ webpage
( url
, display_id
)
35 if '>Queued for processing, please stand by...<' in webpage
:
37 'Audio is still queued for processing' , expected
= True )
39 talk
= self
._ parse
_ json
( self
._ search
_ regex
(
40 r
'initialSnapshot\s*=\s*( {.+?} );' ,
41 webpage
, 'talk' ), display_id
)[ 'talk' ]
44 'url' : urljoin ( url
, talk_url
),
45 'format_id' : format_id
,
46 'ext' : determine_ext ( talk_url
) or format_id
,
48 } for format_id
, talk_url
in talk
[ 'media_links' ]. items ()]
51 'id' : compat_str ( talk
. get ( 'id' ) or display_id
),
52 'display_id' : display_id
,
54 'description' : talk
. get ( 'teaser' ),
55 'thumbnail' : talk
. get ( 'image_url' ),
56 'duration' : int_or_none ( talk
. get ( 'archived_duration' )),
57 'view_count' : int_or_none ( talk
. get ( 'play_count' )),