3 from .common
import InfoExtractor
4 class FranceInterIE(InfoExtractor
):
6 _VALID_URL
=r
'http://www.franceinter.fr/player/reecouter\?play=(?P<id>[0-9]{6})'
9 u
'url':u
'http://www.franceinter.fr/player/reecouter?play=793962',
15 #Easier to use python string matching than regex for a simple match
16 def get_download_url(self
,webpage
):
18 start
=webpage
.index('&urlAOD=')+8
19 end
=webpage
.index('&startTime')
20 return u
'http://www.franceinter.fr/%s'%webpage
[start
:end
]
22 def get_title(self
,webpage
):
23 start
=webpage
.index('<span class="title diffusion">')+30
24 end
=webpage
.index('</span> dans')
26 return webpage
[start
:end
]
27 def _real_extract(self
,url
):
29 mobj
= re
.match(self
._VALID
_URL
, url
)
30 video_id
= mobj
.group('id')
32 webpage
=self
._download
_webpage
(url
,video_id
)
34 title
=self
.get_title(webpage
)
36 video_url
=self
.get_download_url(webpage
)
38 return{'id': video_id,u'url': video_url,u'title': title}