From 1fd6d40c9aa11f36d9985021f3e6b051a4b853e7 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Wed, 5 Jul 2017 22:49:58 -0600 Subject: [PATCH] [cjsw] Requested fixes --- youtube_dl/extractor/cjsw.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/youtube_dl/extractor/cjsw.py b/youtube_dl/extractor/cjsw.py index 81c1ae4df..087cac9bc 100644 --- a/youtube_dl/extractor/cjsw.py +++ b/youtube_dl/extractor/cjsw.py @@ -2,9 +2,6 @@ from __future__ import unicode_literals from .common import InfoExtractor -from ..utils import ( - ExtractorError, -) class CJSWIE(InfoExtractor): @@ -26,17 +23,13 @@ class CJSWIE(InfoExtractor): webpage = self._download_webpage(url, episode_id) - episode_controls = self._search_regex(r']+class=(["\'])episode-controls\1[^>]*>', webpage, 'episode_controls', fatal=False) - if not episode_controls: - raise ExtractorError('No streamable podcast', video_id=episode_id, expected=True) - - title = self._html_search_regex( - r']+data-showname=(["\'])(?P.+?)\1[^>]*>', webpage, 'title', group='title') + title = self._search_regex( + r'<button[^>]+data-showname=(["\'])(?P<title>(?!\1).+?)\1[^>]*>', webpage, 'title', group='title') description = self._html_search_regex( r'<p>(?P<description>.+?)</p>', webpage, 'description', fatal=False) formats = [{ - 'url': self._html_search_regex( - r'<button[^>]+data-audio-src=(["\'])(?P<audio_url>.+?)\1[^>]*>', webpage, 'audio_url', group='audio_url'), + 'url': self._search_regex( + r'<button[^>]+data-audio-src=(["\'])(?P<audio_url>(?!\1).+?)\1[^>]*>', webpage, 'audio_url', group='audio_url'), 'ext': 'mp3', 'vcodec': 'none', }]