]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/cartoonnetwork.py
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': 'https://token.vgtf.net/token/token_mobile',
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',