From 5ef679391f246356e32f8016cb04866e383edbe5 Mon Sep 17 00:00:00 2001 From: Robert Jacobson Date: Sat, 21 Mar 2020 21:46:55 -0400 Subject: [PATCH] cleanup unused code --- youtube_dl/extractor/digitalconcerthall.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/digitalconcerthall.py b/youtube_dl/extractor/digitalconcerthall.py index d64ed3e24..4ff03804b 100644 --- a/youtube_dl/extractor/digitalconcerthall.py +++ b/youtube_dl/extractor/digitalconcerthall.py @@ -16,7 +16,7 @@ from ..utils import ( class DigitalConcertHallIE(InfoExtractor): IE_DESC = 'DigitalConcertHall extractor' _VALID_URL = r'https?://(?:www\.)?digitalconcerthall\.com/(?P[a-z]+)/concert/(?P[0-9]+)' - _TESTS = [{ + _TEST = { 'url': 'https://www.digitalconcerthall.com/en/concert/51841', 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', 'info_dict': { @@ -26,7 +26,7 @@ class DigitalConcertHallIE(InfoExtractor): 'title': 'Video title goes here', 'thumbnail': r're:^https?://.*/images/core/Phil.*\.jpg$', } - },] + } def debug_out(self, args): if not self._downloader.params.get('verbose', False): @@ -43,9 +43,7 @@ class DigitalConcertHallIE(InfoExtractor): title = self._html_search_regex(r'(.+?)', webpage, 'title') self.to_screen("title: " + title) - # this returns JSON, which contains the urls of the playlist - #video_data = self._download_webpage( - # 'https://www.digitalconcerthall.com/json_services/get_stream_urls?id=' + video_id + "&language=" + language, video_id) + # this returns JSON containing the urls of the playlist playlist_dict = self._download_json( 'https://www.digitalconcerthall.com/json_services/get_stream_urls?id=' + video_id + "&language=" + language, video_id)['urls'] @@ -56,6 +54,7 @@ class DigitalConcertHallIE(InfoExtractor): self.debug_out("key url: " + m3u8_url) formats = self._extract_m3u8_formats(m3u8_url, key, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False) self.debug_out(formats) + # the div with id=key contains the video title vid_info_div = clean_html(get_element_by_id(key, webpage)) self.debug_out("vid_info_div:\n" + vid_info_div) title = re.sub('\s+', ' ', vid_info_div) @@ -67,9 +66,6 @@ class DigitalConcertHallIE(InfoExtractor): 'formats': formats, }) -# for i in entries: -# print(i) - return { '_type': 'playlist', 'id': video_id,