X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/af478477605bdf3f5d57562035885cfee905f379..c512650955de0b16d37e7fa7fb29ea0985e415bb:/youtube_dl/extractor/rtbf.py diff --git a/youtube_dl/extractor/rtbf.py b/youtube_dl/extractor/rtbf.py new file mode 100644 index 0000000..205f8a1 --- /dev/null +++ b/youtube_dl/extractor/rtbf.py @@ -0,0 +1,49 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re +import json + +from .common import InfoExtractor + + +class RTBFIE(InfoExtractor): + _VALID_URL = r'https?://www.rtbf.be/video/[^\?]+\?id=(?P\d+)' + _TEST = { + 'url': 'https://www.rtbf.be/video/detail_les-diables-au-coeur-episode-2?id=1921274', + 'md5': '799f334ddf2c0a582ba80c44655be570', + 'info_dict': { + 'id': '1921274', + 'ext': 'mp4', + 'title': 'Les Diables au coeur (épisode 2)', + 'description': 'Football - Diables Rouges', + 'duration': 3099, + 'timestamp': 1398456336, + 'upload_date': '20140425', + } + } + + def _real_extract(self, url): + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + + page = self._download_webpage('https://www.rtbf.be/video/embed?id=%s' % video_id, video_id) + + data = json.loads(self._html_search_regex( + r'