U
    g@                     @   s4   d dl Z ddlmZ ddlmZ G dd deZdS )    N   )InfoExtractor   )int_or_nonec                
   @   s>   e Zd ZdZdddddddd	d
dddddgZdd ZdS )XanimuIEz.https?://(?:www\.)?xanimu\.com/(?P<id>[^/]+)/?z6https://xanimu.com/51944-the-princess-the-frog-hentai/Z 899b88091d753d92dad4cb63bbf357a7z"51944-the-princess-the-frog-hentaiZmp4zThe Princess + The Frog HentaizGhttps://xanimu.com/storage/2020/09/the-princess-and-the-frog-hentai.jpgz)re:^Enjoy The Princess \+ The Frog Hentaig     i@   )idexttitle	thumbnaildescriptionduration	age_limit)urlmd5Z	info_dictz"https://xanimu.com/huge-expansion/T)r   Zonly_matchingc                 C   s   |  |}| ||}g }dD ]L}| jdt| d|||d dd}|r||||dr`dnd d q||| jd	|d
d dp| || j	d|d d| j	d|d dt
| jd|dddddS )N)Z	videoHighZvideoLowzvar\s+z\s*=z[\'"]([^\'"]+)[\'"])defaultZcontains_patternZLow)r   	format_idZqualityz'[\'"]headline[\'"]:\s*[\'"]([^"]+)[\'"]r
   )r   ZthumbnailUrlr   z duration:\s*[\'"]([^\'"]+?)[\'"]r   F)fatalr   )r   formatsr
   r   r   r   r   )Z	_match_idZ_download_webpageZ_search_jsonreescapeappendendswithZ_search_regexZ_html_extract_titleZ_html_search_metar   )selfr   Zvideo_idZwebpager   r   Z
format_url r   ;/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/xanimu.py_real_extract   sD    
    
   zXanimuIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTSr   r   r   r   r   r      s"   r   )r   commonr   utilsr   r   r   r   r   r   <module>   s   