2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..utils import int_or_none
8 class TouTvIE(InfoExtractor):
10 _VALID_URL = r'https?://ici\.tou\.tv/(?P<id>[a-zA-Z0-9_-]+/S[0-9]+E[0-9]+)'
13 'url': 'http://ici.tou.tv/garfield-tout-court/S2015E17',
17 'title': 'Saison 2015 Épisode 17',
18 'description': 'La photo de famille 2',
19 'upload_date': '20100717',
23 'skip_download': True,
27 def _real_extract(self, url):
28 path = self._match_id(url)
29 metadata = self._download_json('http://ici.tou.tv/presentation/%s' % path, path)
30 video_id = metadata['IdMedia']
31 details = metadata['Details']
32 title = details['OriginalTitle']
35 '_type': 'url_transparent',
36 'url': 'radiocanada:%s:%s' % (metadata.get('AppCode', 'toutv'), video_id),
39 'thumbnail': details.get('ImageUrl'),
40 'duration': int_or_none(details.get('LengthInSeconds')),