o
    i	                     @   s@   d dl Z ddlmZ ddlmZmZmZmZ G dd deZdS )    N   )InfoExtractor   )determine_extdetermine_protocolint_or_noneparse_durationc                   @   s:   e Zd ZdZdZddddddd	d
ddidZdd ZdS )Lecture2GoIEFzDhttps?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(?P<id>\d+)z;https://lecture2go.uni-hamburg.de/veranstaltungen/-/v/17473 ac02b570883020d208d405d5a3fd2f7f17473mp4u-   2 - Endliche Automaten und reguläre SprachenzFrank Heitmannid  )idexttitlecreatordurationskip_downloadT)urlmd5	info_dictparamsc              	   C   s   |  |}| ||}| d|d}g }ttd|D ]:}t|}td|i}|dkr8|| j	||dd q|dkrI|| j
||d	d
d q|dkrNq|||d q| jd|ddd}t| jd|ddd}	t| jd|ddd}
|||||	|
dS )Nz<em[^>]+class="title">(.+)</em>r   z"var\s+playerUri\d+\s*=\s*"([^"]+)"r   f4mhds)f4m_idm3u8r   hls)r   m3u8_idrtmp)	format_idr   z'<div[^>]+id="description">([^<]+)</div>r   F)fatalz)Duration:\s*</em>\s*<em[^>]*>([^<]+)</em>r   z$Views:\s*</em>\s*<em[^>]+>(\d+)</em>z
view count)r   r   formatsr   r   
view_count)	_match_id_download_webpage_html_search_regexsetrefindallr   r   extend_extract_f4m_formats_extract_m3u8_formatsappendr   r   )selfr   video_idwebpager   r    r   protocolr   r   r!    r0   O/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/lecture2go.py_real_extract   sB   

zLecture2GoIE._real_extractN)__name__
__module____qualname___WORKING
_VALID_URL_TESTr2   r0   r0   r0   r1   r	      s    	r	   )	r&   commonr   utilsr   r   r   r   r	   r0   r0   r0   r1   <module>   s    