2 from __future__ import unicode_literals
4 from .common import InfoExtractor
7 class EggheadCourseIE(InfoExtractor):
8 IE_DESC = 'egghead.io course'
9 IE_NAME = 'egghead:course'
10 _VALID_URL = r'https://egghead\.io/courses/(?P<id>[a-zA-Z_0-9-]+)'
12 'url': 'https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript',
15 'id': 'professor-frisby-introduces-composable-functional-javascript',
16 'title': 'Professor Frisby Introduces Composable Functional JavaScript',
17 'description': 're:(?s)^This course teaches the ubiquitous.*You\'ll start composing functionality before you know it.$',
21 def _real_extract(self, url):
22 playlist_id = self._match_id(url)
23 api_url = 'https://egghead.io/api/v1/series/' + playlist_id
24 course = self._download_json(api_url, playlist_id)
25 title = course.get('title')
26 description = course.get('description')
28 lessons = course.get('lessons')
29 entries = [{'_type': 'url', 'ie_key': 'Wistia', 'url': 'wistia:' + l.get('wistia_id')} for l in lessons]
35 'description': description,