From f0b34bccc05a500dba5d5e530938ddabb8300d65 Mon Sep 17 00:00:00 2001 From: TheDaChicken Date: Mon, 27 Aug 2018 18:17:30 -0700 Subject: [PATCH] [Cartoonnetwork] Allowing more support if the website changes. --- youtube_dl/extractor/cartoonnetwork.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/cartoonnetwork.py b/youtube_dl/extractor/cartoonnetwork.py index f267a15da..a2f711563 100644 --- a/youtube_dl/extractor/cartoonnetwork.py +++ b/youtube_dl/extractor/cartoonnetwork.py @@ -1,6 +1,8 @@ # coding: utf-8 from __future__ import unicode_literals +import re + from .turner import TurnerBaseIE @@ -23,14 +25,14 @@ class CartoonNetworkIE(TurnerBaseIE): def _real_extract(self, url): display_id = self._match_id(url) webpage = self._download_webpage(url, display_id) - video_id = self._html_search_regex(r'_cnglobal.currentVideo.mediaId = "(.+?)"', webpage, 'video_id') - title = self._html_search_regex(r'_cnglobal.currentVideo.episodeTitle = "(.+?)"', webpage, 'title') - auth_required = self._html_search_regex(r'_cnglobal.currentVideo.authType = "(.+?)"', webpage, 'authType') - videoType = self._html_search_regex(r'_cnglobal.currentVideo.videoType = "(.+?)"', webpage, 'videoType') + video_id = self._html_search_regex(r'[^>]+.mediaId = "(.+?)"', webpage, 'video_id') + title = self._html_search_regex(r'[^>]+.episodeTitle = "(.+?)"', webpage, 'title') + auth_required = self._html_search_regex(r'[^>]+.authType = "(.+?)"', webpage, 'authType') + videoType = self._html_search_regex(r'[^>]+.videoType = "(.+?)"', webpage, 'videoType') if 'short' in videoType: description = '' else: - description = self._html_search_regex(r'
(.+?)
', webpage, 'description') + description = self._html_search_regex(r'