1 from __future__ import unicode_literals
5 from .common import InfoExtractor
6 from ..utils import parse_duration
9 class RtlXlIE(InfoExtractor):
11 _VALID_URL = r'https?://www\.rtlxl\.nl/#!/[^/]+/(?P<uuid>[^/?]+)'
14 'url': 'http://www.rtlxl.nl/#!/rtl-nieuws-132237/6e4203a6-0a5e-3596-8424-c599a59e0677',
16 'id': '6e4203a6-0a5e-3596-8424-c599a59e0677',
18 'title': 'RTL Nieuws - Laat',
19 'description': 'Dagelijks het laatste nieuws uit binnen- en '
20 'buitenland. Voor nog meer nieuws kunt u ook gebruikmaken van '
22 'timestamp': 1408051800,
23 'upload_date': '20140814',
27 # We download the first bytes of the first fragment, it can't be
28 # processed by the f4m downloader beacuse it isn't complete
29 'skip_download': True,
33 def _real_extract(self, url):
34 mobj = re.match(self._VALID_URL, url)
35 uuid = mobj.group('uuid')
37 info = self._download_json(
38 'http://www.rtl.nl/system/s4m/vfd/version=2/uuid=%s/fmt=flash/' % uuid,
41 material = info['material'][0]
42 episode_info = info['episodes'][0]
44 f4m_url = 'http://manifest.us.rtl.nl' + material['videopath']
45 progname = info['abstracts'][0]['name']
46 subtitle = material['title'] or info['episodes'][0]['name']
50 'title': '%s - %s' % (progname, subtitle),
51 'formats': self._extract_f4m_formats(f4m_url, uuid),
52 'timestamp': material['original_date'],
53 'description': episode_info['synopsis'],
54 'duration': parse_duration(material.get('duration')),