o
    i                     @   s0   d dl mZ ddlmZmZ G dd deZdS )   )InfoExtractor   )int_or_noneurl_or_nonec                   @   s&   e Zd ZdZddddgZdd ZdS )	CamModelsIEz6https?://(?:www\.)?cammodels\.com/cam/(?P<id>[^/?#&]+)z+https://www.cammodels.com/cam/AutumnKnight/T   )urlonly_matching	age_limitc                 C   s  |  |}| d| d|}g }g }|d  D ]\}}t|ts#q|d}t|ts.q|d}	|d}
|D ]}}t|tsBq:t|d}|sLq:|g}t|d}|d urb|	| d	 |d

|t|d|t|dt|dt|d|	|
d	}d|v rd|d< n$d|v r|ddd n|dkr|	|d |d |d |d d q:|	| q:q|||d|ddS ) Nz0https://manifest-server.naiadsystems.com/live/s:z.jsonformats	encodings
videoCodec
audioCodeclocationvideoHeightp-
videoWidth	videoKbps	audioKbpsfps)	r   	format_idwidthheightvbrabrr   vcodecacodecrtmpflvexthlsmp4i)r    qualityjpegr   r   r   r   )r   r   r   r   Tr   )idtitle
thumbnailsis_liver   r
   )	_match_id_download_jsonitems
isinstancedictgetlistr   r   appendjoinupdate)selfr   user_idmanifestr   r'   r   format_dictr   r   r   media	media_urlformat_id_listr   f r;   N/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/cammodels.py_real_extract   st   








*zCamModelsIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSr=   r;   r;   r;   r<   r      s    r   N)commonr   utilsr   r   r   r;   r;   r;   r<   <module>   s    