o
    i                     @   s4   d dl mZ ddlmZmZmZ G dd deZdS )   )InfoExtractor   )int_or_nonetry_geturlencode_postdatac                   @   sL   e Zd ZdZdddddddddd	d
ddeddddidgZdd ZdS )BongaCamsIEzIhttps?://(?P<host>(?:[^/]+\.)?bongacams\d*\.(?:com|net))/(?P<id>[^/?&#]+)z https://de.bongacams.com/azumi-8T)urlonly_matchingz https://cn.bongacams.com/azumi-8z%https://de.bongacams.net/claireashtonclaireashtonmp4z-re:ClaireAshton \d{4}-\d{2}-\d{2} \d{2}:\d{2}   ClaireAshton)idexttitle	age_limituploader_iduploader
like_countis_liveskip_download)r   	info_dictparamsc              	   C   s   |  |}|d}|d}| jd| d|tdd|fdfdd	id
}|d d }t|dd tp4|}t|dd t}tt|dd }	| j| d| d|dddd}
||pZ||||	dd|
dS )Nhostr   zhttps://z/tools/amf.php)methodgetRoomDataargs[])r   falsezX-Requested-WithXMLHttpRequest)dataheaders	localDatavideoServerUrlc                 S      | d d S )NperformerDatausername xr&   r&   N/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/bongacams.py<lambda>2       z+BongaCamsIE._real_extract.<locals>.<lambda>c                 S   r#   )Nr$   displayNamer&   r'   r&   r&   r)   r*   4   r+   c                 S   r#   )Nr$   loversCountr&   r'   r&   r&   r)   r*   6   r+   z/hls/stream_z/playlist.m3u8r   hlsT)m3u8_idliver   )r   r   r   r   r   r   r   formats)_match_valid_urlgroup_download_jsonr   r   strr   _extract_m3u8_formats)selfr   mobjr   
channel_idamf
server_urlr   r   r   r1   r&   r&   r)   _real_extract"   sJ   




zBongaCamsIE._real_extractN)__name__
__module____qualname__
_VALID_URLint_TESTSr<   r&   r&   r&   r)   r   	   s.    r   N)commonr   utilsr   r   r   r   r&   r&   r&   r)   <module>   s    