2 from __future__ import unicode_literals
6 from .turner import TurnerBaseIE
9 class CartoonNetworkIE(TurnerBaseIE):
10 _VALID_URL = r'https?://(?:www\.)?cartoonnetwork\.com/video/(?:[^/]+/)+(?P<id>[^/?#]+)-(?:clip|episode)\.html'
12 'url': 'http://www.cartoonnetwork.com/video/teen-titans-go/starfire-the-cat-lady-clip.html',
14 'id': '8a250ab04ed07e6c014ef3f1e2f9016c',
16 'title': 'Starfire the Cat Lady',
17 'description': 'Robin decides to become a cat so that Starfire will finally love him.',
21 'skip_download': True,
25 def _real_extract(self, url):
26 display_id = self._match_id(url)
27 webpage = self._download_webpage(url, display_id)
28 id_type, video_id = re.search(r"_cnglobal\.cvp(Video|Title)Id\s*=\s*'([^']+)';", webpage).groups()
29 query = ('id' if id_type == 'Video' else 'titleId') + '=' + video_id
30 return self._extract_cvp_info(
31 'http://www.cartoonnetwork.com/video-seo-svc/episodeservices/getCvpPlaylist?networkName=CN2&' + query, video_id, {
33 'media_src': 'http://androidhls-secure.cdn.turner.com/toon/big',
34 'tokenizer_src': 'http://www.cartoonnetwork.com/cntv/mvpd/processors/services/token_ipadAdobe.do',
38 'site_name': 'CartoonNetwork',
39 'auth_required': self._search_regex(
40 r'_cnglobal\.cvpFullOrPreviewAuth\s*=\s*(true|false);',
41 webpage, 'auth required', default='false') == 'true',