[CartoonNetwork] Changed cvp to ngtv
Changed cvp to ngtv and also fixed AttributeError: 'NoneType' object has no attribute 'groups'
This commit is contained in:
parent
0a74b45191
commit
091e3cc417
@ -25,18 +25,33 @@ class CartoonNetworkIE(TurnerBaseIE):
|
|||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
id_type, video_id = re.search(r"_cnglobal\.cvp(Video|Title)Id\s*=\s*'([^']+)';", webpage).groups()
|
#id_type, video_id = re.search(r"_cnglobal\.cvp(Video|Title)Id\s*=\s*'([^']+)';", webpage).groups()
|
||||||
query = ('id' if id_type == 'Video' else 'titleId') + '=' + video_id
|
#video_id = 'a182d531dab41469af2f3101e1d52ef09465e338'
|
||||||
return self._extract_cvp_info(
|
for line in webpage.splitlines():
|
||||||
'http://www.cartoonnetwork.com/video-seo-svc/episodeservices/getCvpPlaylist?networkName=CN2&' + query, video_id, {
|
if "_cnglobal.currentVideo.mediaId" in line:
|
||||||
'secure': {
|
simpleid = line.split('mediaId = "',1)[1]
|
||||||
'media_src': 'http://androidhls-secure.cdn.turner.com/toon/big',
|
video_id = simpleid.replace('";', '')
|
||||||
'tokenizer_src': 'https://token.vgtf.net/token/token_mobile',
|
if "_cnglobal.currentVideo.episodeTitle" in line:
|
||||||
},
|
simpletitle = line.split('episodeTitle = "',1)[1]
|
||||||
}, {
|
title = simpletitle.replace('";', '')
|
||||||
|
print(title)
|
||||||
|
description = ''
|
||||||
|
#query = ('id' if id_type == 'Video' else 'titleId') + '=' + video_id
|
||||||
|
|
||||||
|
info = self._extract_ngtv_info(
|
||||||
|
video_id,
|
||||||
|
{'networkId': 'cartoonnetwork'},
|
||||||
|
{
|
||||||
'url': url,
|
'url': url,
|
||||||
'site_name': 'CartoonNetwork',
|
'site_name': 'CartoonNetwork',
|
||||||
'auth_required': self._search_regex(
|
'auth_required': self._search_regex(
|
||||||
r'_cnglobal\.cvpFullOrPreviewAuth\s*=\s*(true|false);',
|
r'_cnglobal\.cvpFullOrPreviewAuth\s*=\s*(true|false);',
|
||||||
webpage, 'auth required', default='false') == 'true',
|
webpage, 'auth required', default='false') == 'true',
|
||||||
})
|
},
|
||||||
|
)
|
||||||
|
info.update({
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'description': description,
|
||||||
|
})
|
||||||
|
return info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user