U
    gM                     @   s(   d dl Z ddlmZ G dd deZdS )    N   )InfoExtractorc                   @   s0   e Zd ZdZdZddddddd	Zd
d ZdS )AcademicEarthCourseIEz?https?://(?:www\.)?academicearth\.org/playlists/(?P<id>[^?#/]+)zAcademicEarth:Coursez2http://academicearth.org/playlists/laws-of-nature/zlaws-of-naturezLaws of NaturezmIntroduce yourself to the laws of nature with these free online college lectures from Yale, Harvard, and MIT.)idtitledescription   )urlZ	info_dictZplaylist_countc                    sd     |} ||} d|d} jd|ddd}td|} fdd	|D }d
||||dS )Nz*<h1 class="playlist-name"[^>]*?>(.*?)</h1>r   z"<p class="excerpt"[^>]*?>(.*?)</p>r   F)fatalzB<li class="lecture-preview">\s*?<a target="_blank" href="([^"]+)">c                    s   g | ]}  |qS  )Z
url_result).0uselfr   B/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/academicearth.py
<listcomp>   s     z7AcademicEarthCourseIE._real_extract.<locals>.<listcomp>Zplaylist)_typer   r   r   entries)Z	_match_idZ_download_webpageZ_html_search_regexrefindall)r   r	   Zplaylist_idZwebpager   r   urlsr   r   r   r   _real_extract   s0    
    z#AcademicEarthCourseIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZIE_NAMEZ_TESTr   r   r   r   r   r      s   
r   )r   commonr   r   r   r   r   r   <module>   s   