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