o
    i                     @   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   )ExtractorErrortraverse_objc                   @   s4   e Zd ZdZddddedddd	d
gZdd ZdS )	CamsodaIEz)https?://www\.camsoda\.com/(?P<id>[\w-]+)z https://www.camsoda.com/lizzhopflizzhopfmp4zBlizzhopf (lizzhopf) Nude on Cam. Free Live Sex Chat Room - CamSodaT   )idexttitledescriptionis_live	age_limitzRoom is offline)url	info_dictskipc           	   	   C   s  |  |}| j|||  d}| jd| |ddtdd i|  d}|s,td|d	r7td
dd|dsBtdddt|dt	d}t|dt	d}g }t|dD ]}| j
d| d| d| |ddddd}|rq nqW|s{| jddd || || jd|d dd|ddS )N)headersz(https://camsoda.com/api/v1/video/vtoken/usernameguest_i'  i )queryr   z(Unable to find configuration for stream.private_serverszModel is in private show.T)expectedstream_namezModel is offline.)expected_typetoken)edge_servers.zhttps:///z_v1/index.m3u8?token=r	   hlsF)r   m3u8_idfatallivezNo active streams foundr   )defaultr
   )r   r   r   r   formatsr   )	_match_id_download_webpagegeo_verification_headers_download_jsonrandom	randranger   getr   str_extract_m3u8_formatsraise_no_formats_html_extract_title_html_search_meta)	selfr   video_idwebpagedatar   r   r$   server r6   L/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/camsoda.py_real_extract   sB   




zCamsodaIE._real_extractN)__name__
__module____qualname__
_VALID_URLr,   _TESTSr8   r6   r6   r6   r7   r      s    r   )r)   commonr   utilsr   r   r   r6   r6   r6   r7   <module>   s    