1 from __future__ import unicode_literals
5 from .common import InfoExtractor
8 class AcademicEarthCourseIE(InfoExtractor):
9 _VALID_URL = r'^https?://(?:www\.)?academicearth\.org/playlists/(?P<id>[^?#/]+)'
10 IE_NAME = 'AcademicEarth:Course'
12 'url': 'http://academicearth.org/playlists/laws-of-nature/',
14 'id': 'laws-of-nature',
15 'title': 'Laws of Nature',
16 'description': 'Introduce yourself to the laws of nature with these free online college lectures from Yale, Harvard, and MIT.',
21 def _real_extract(self, url):
22 playlist_id = self._match_id(url)
24 webpage = self._download_webpage(url, playlist_id)
25 title = self._html_search_regex(
26 r'<h1 class="playlist-name"[^>]*?>(.*?)</h1>', webpage, 'title')
27 description = self._html_search_regex(
28 r'<p class="excerpt"[^>]*?>(.*?)</p>',
29 webpage, 'description', fatal=False)
31 r'<li class="lecture-preview">\s*?<a target="_blank" href="([^"]+)">',
33 entries = [self.url_result(u) for u in urls]
39 'description': description,