1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp synced 2025-01-18 23:03:05 +01:00
yt-dlp/youtube_dl/extractor/franceinter.py

31 lines
923 B
Python
Raw Normal View History

from __future__ import unicode_literals
2014-01-15 11:49:50 +05:30
import re
from .common import InfoExtractor
class FranceInterIE(InfoExtractor):
_VALID_URL=r'http://(?:www\.)?franceinter\.fr/player/reecouter\?play=(?P<id>[0-9]{6})'
2014-01-15 11:49:50 +05:30
_TEST={
u'url':u'http://www.franceinter.fr/player/reecouter?play=793962',
u'file':u'793962.mp3'
2014-01-15 11:49:50 +05:30
}
2014-01-15 11:49:50 +05:30
2014-01-15 11:49:50 +05:30
def _real_extract(self,url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
webpage=self._download_webpage(url,video_id)
title=self._search_regex(u'(?<=<span class="roll_overflow">)(.*)(?=</span></h1>)', webpage, u'title')
2014-01-15 11:49:50 +05:30
video_url='http://www.franceinter.fr/'+self._search_regex(u'(?<=&urlAOD=)(.*)(?=&startTime)', webpage, u'video url')
2014-01-15 11:49:50 +05:30
return{'id': video_id,u'url': video_url,u'title': title}