]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/academicearth.py
1 from __future__
import unicode_literals
4 from .common
import InfoExtractor
7 class AcademicEarthCourseIE(InfoExtractor
):
8 _VALID_URL
= r
'^https?://(?:www\.)?academicearth\.org/playlists/(?P<id>[^?#/]+)'
9 IE_NAME
= 'AcademicEarth:Course'
11 'url': 'http://academicearth.org/playlists/laws-of-nature/',
13 'id': 'laws-of-nature',
14 'title': 'Laws of Nature',
15 'description': 'Introduce yourself to the laws of nature with these free online college lectures from Yale, Harvard, and MIT.',
20 def _real_extract(self
, url
):
21 m
= re
.match(self
._VALID
_URL
, url
)
22 playlist_id
= m
.group('id')
24 webpage
= self
._download
_webpage
(url
, playlist_id
)
25 title
= self
._html
_search
_regex
(
26 r
'<h1 class="playlist-name"[^>]*?>(.*?)</h1>', webpage
, u
'title')
27 description
= self
._html
_search
_regex
(
28 r
'<p class="excerpt"[^>]*?>(.*?)</p>',
29 webpage
, u
'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
,