U
    g	                     @   s8   d dl ZddlmZ ddlmZmZ G dd deZdS )    N   )InfoExtractor   )traverse_objupdate_url_queryc                   @   s^   e Zd ZddgZdddddded	d
diddddddddd
diddddgZdd ZdS )ScreencastifyIEz4https?://watch\.screencastify\.com/v/(?P<id>[^/?#]+)z<https?://app\.screencastify\.com/v[23]/watch/(?P<id>[^/?#]+)z6https://watch.screencastify.com/v/sYVkZip3quLKhHw4Ybk8ZsYVkZip3quLKhHw4Ybk8mp4z.Inserting and Aligning the Case Top and Bottom z	Paul Gunn)idexttitledescriptionuploaderextra_param_to_segment_urlZskip_downloadZm3u8)urlZ	info_dictparamsz;https://app.screencastify.com/v3/watch/J5N7H11wofDN1jZUCr3tZJ5N7H11wofDN1jZUCr3tzScott PiesenzLesson Recording 1-17 Burrr...)r
   r   r   r   r   z;https://app.screencastify.com/v2/watch/BQ26VbUdfbQLhKzkktOkT)r   Zonly_matchingc           
   
   C   s   |  |}| d| |}t|d}tj|}g }t|d}|r^|| j||d|dd t|d}|r|| j||dd	|dd
 |D ]}	t	|	d ||	d< q||
d|
d|
d||dS )NzAhttps://umbrella.svc.screencastify.com/api/umbrellaService/watch/)manifestauthquery)r   r   ZdashF)Zmpd_idr   fatal)r   ZhlsUrlr   Zhls)r   Zm3u8_idr   r   r   r   r   ZuserName)r
   r   r   r   formatsr   )Z	_match_idZ_download_jsonr   urllibparseparse_qsextendZ_extract_mpd_formatsZ_extract_m3u8_formatsr   get)
selfr   Zvideo_idinfoZquery_stringr   r   Zdash_manifest_urlZhls_manifest_urlf r   B/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/screencastify.py_real_extract*   sP    
 

    
     zScreencastifyIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLstrZ_TESTSr!   r   r   r   r    r      s>   	  r   )urllib.parser   commonr   utilsr   r   r   r   r   r   r    <module>   s   