1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-07 06:47:14 +08:00

Create ibmThink.py

[ibmThink] for school project, attempted to implement ibm Think 2020 extraction access
This commit is contained in:
msrimat 2019-12-08 18:46:02 -05:00 committed by GitHub
parent 8b16846cd1
commit 6352304f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,30 @@
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .generic import GenericIE
class IbmThinkPlaylistIE(InfoExtractor):
IE_DESC = 'IBM Think Playlist'
IE_NAME = 'IBMThink:playlist'
_VALID_URL = r'https?://(?:www\.)?ibm\.com/events/think/watch/playlist/(?P<id>[0-9]+)/?'
_TESTS = [{
'url': 'https://www.ibm.com/events/think/watch/playlist/468067/',
'info_dict': {
'id': '468067',
'title': 'Think 2020',
'description': 'Keynotes'
},
'playlist_mincount': 5
}]
def _real_extract(self, url):
playlist_id = self._match_id(url)
webpage = self._download_webpage(url, playlist_id)
entries = [self.url_result(m, GenericIE.ie_key()) for m in re.findall(r'<a href="(.+?)" class="video-list-item js-video-list-item">', webpage)]
title = self._html_search_regex(r'<title>.+?\s\|\s.+?\s\|\s(.+?)</title>', webpage, 'title', fatal=False)
description = self._og_search_description(webpage)
return self.playlist_result(entries, playlist_id, title, description)