3
b`                 @   s@   d dl mZ ddlmZ ddlmZmZmZ G dd deZdS )	    )unicode_literals   )InfoExtractor   )ExtractorError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  | j |}| j||| j d}| jd|dd d}|spd)}x*|D ]\}}||kr>|}d}	P q>W d}d}	t||	d| jd||f |}
g }x.|
d j D ]\}}t|tsq|j	d}t|t
sq|j	d}|j	d}x|D ]}t|t sqt|j	d}|sq|g}t|j	d}|d k	r2|jd|  |dj|t|j	d|t|j	dt|j	dt|j	d||d	}d|krd|d< nd |kr|jd!d*d# nq|j| qW qW | j| || j|d|d$d%S )+N)headerszmanifestUrlRoot=([^&\']+)manifest)default%I'm offline, but let's stay connectedThis user is currently offlinein a private showThis user is in a private showis currently performing LIVE'This model is currently performing liveTz Unable to find manifest URL rootF)expectedz	%s%s.jsonformats	encodings
videoCodec
audioCodeclocationvideoHeightz%dp-
videoWidthZ	videoKbpsZ	audioKbpsfps)	r   	format_idwidthheightvbrabrr    vcodecacodecrtmpflvexthlsmp4r   )r*   
preferencer
   )idtitleis_liver   r   r   r   r   r   r   r   )r1   r2   r3   )	_match_id_download_webpagegeo_verification_headers_html_search_regexr   _download_jsonitems
isinstancedictgetlistr   r   appendjoinupdate_sort_formats_live_title)selfr   user_idwebpageZmanifest_rootERRORSpatternmessageerrorr   r   r   r!   format_dictr   r&   r'   media	media_urlformat_id_listr#   f rP   JC:\Users\Broad\Desktop\All-Down\binaries\youtube_dl\extractor\cammodels.py_real_extract   sz    
  









zCamModelsIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSrR   rP   rP   rP   rQ   r	      s
   
r	   N)	
__future__r   commonr   utilsr   r   r   r	   rP   rP   rP   rQ   <module>   s   