]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/academicearth.py
3 from .common
import InfoExtractor
6 class AcademicEarthCourseIE(InfoExtractor
):
7 _VALID_URL
= r
'^https?://(?:www\.)?academicearth\.org/(?:courses|playlists)/(?P<id>[^?#/]+)'
8 IE_NAME
= u
'AcademicEarth:Course'
10 def _real_extract(self
, url
):
11 m
= re
.match(self
._VALID
_URL
, url
)
12 playlist_id
= m
.group('id')
14 webpage
= self
._download
_webpage
(url
, playlist_id
)
15 title
= self
._html
_search
_regex
(
16 r
'<h1 class="playlist-name">(.*?)</h1>', webpage
, u
'title')
17 description
= self
._html
_search
_regex
(
18 r
'<p class="excerpt">(.*?)</p>',
19 webpage
, u
'description', fatal
=False)
21 r
'<h3 class="lecture-title"><a target="_blank" href="([^"]+)">',
23 entries
= [self
.url_result(u
) for u
in urls
]
29 'description': description
,