From 285eefc81b76eb0743d9d86bc1081105fc64d86b Mon Sep 17 00:00:00 2001 From: Parth Verma Date: Sun, 29 Apr 2018 22:32:46 +0530 Subject: [PATCH] [ibm think videos] Added new extractor --- youtube_dl/extractor/extractors.py | 4 +++ youtube_dl/extractor/ibm_think.py | 55 ++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 youtube_dl/extractor/ibm_think.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 6fb65e4fe..7c8e42ed4 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -450,6 +450,10 @@ from .hrti import ( from .huajiao import HuajiaoIE from .huffpost import HuffPostIE from .hypem import HypemIE +from .ibm_think import ( + IbmThinkIE, + IbmThinkPlaylistIE, +) from .iconosquare import IconosquareIE from .ign import ( IGNIE, diff --git a/youtube_dl/extractor/ibm_think.py b/youtube_dl/extractor/ibm_think.py new file mode 100644 index 000000000..815f29d73 --- /dev/null +++ b/youtube_dl/extractor/ibm_think.py @@ -0,0 +1,55 @@ +# coding: utf-8 +from __future__ import unicode_literals + +import re + +from .common import InfoExtractor +from .ustream import UstreamIE + + +class IbmThinkIE(InfoExtractor): + IE_DESC = 'IBM Think Videos' + IE_NAME = 'IBMThink' + _VALID_URL = r'https?://(?:www\.)?ibm\.com/events/think/watch/replay/(?P[0-9]+)/?' + _TESTS = [{ + 'url': 'https://www.ibm.com/events/think/watch/replay/113734399/', + 'md5': '0a3f1c81c58aacbbb36e292a1c1f9690', + 'info_dict': { + 'id': '113734399', + 'ext': 'mp4', + 'title': 'Think 2018 Chairman\'s Address: Putting Smart to Work', + 'timestamp': 1521575552, + 'upload_date': '20180320', + 'uploader': 'f8k4md3yana', + 'uploader_id': '43178333', + } + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + ustream_url = self._html_search_regex(r'[0-9]+)/?' + _TESTS = [{ + 'url': 'https://www.ibm.com/events/think/watch/playlist/241295/', + 'info_dict': { + 'id': '241295', + 'title': 'Five innovations that will help change our lives within five years', + 'description': 'Discover what the world is thinking at Think 2018, IBM\'s first business event to go beyond IT conference, exploring cloud technology, data analytics & security.' + }, + 'playlist_mincount': 6 + }] + + def _real_extract(self, url): + playlist_id = self._match_id(url) + webpage = self._download_webpage(url, playlist_id) + entries = [self.url_result(m) for m in re.findall(r'', webpage)] + title = self._html_search_regex(r'(?:.+?)\s\|\s(?:.+?)\s\|\s(.+?)', webpage, 'title') + description = self._og_search_description(webpage) + return self.playlist_result(entries, playlist_id, title, description)