You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
923 B

  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. class FranceInterIE(InfoExtractor):
  5. _VALID_URL=r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]{6})'
  6. _TEST={
  7. u'url':u'http://www.franceinter.fr/player/reecouter?play=793962',
  8. u'file':u'793962.mp3'
  9. }
  10. def _real_extract(self,url):
  11. mobj = re.match(self._VALID_URL, url)
  12. video_id = mobj.group('id')
  13. webpage=self._download_webpage(url,video_id)
  14. title=self._search_regex(u'(?<=<span class="roll_overflow">)(.*)(?=</span></h1>)', webpage, u'title')
  15. video_url='http://www.franceinter.fr/'+self._search_regex(u'(?<=&urlAOD=)(.*)(?=&startTime)', webpage, u'video url')
  16. return{'id': video_id,u'url': video_url,u'title': title}