o
    i	                     @   sH   d dl mZ ddlmZmZmZmZmZ ddlm	Z	 G dd deZ
dS )   )InfoExtractor   )determine_extint_or_nonejoin_nonempty
remove_endurl_or_none)traverse_objc                   @   sX   e Zd ZdZdZddddddd	d
ddddddd
ddddddd
gZdd ZdS )	YfanefaIEyfanefaz.https?://(?:www\.)?yfanefa\.com/(?P<id>[^?#]+)z#https://www.yfanefa.com/record/2717zrecord-2717mp4z.THE HALLAMSHIRE RIFLES LEAVING SHEFFIELD, 1914iw  z/re:https://media\.yfanefa\.com/storage/v1/file/)idexttitleduration	thumbnail)url	info_dictzhttps://www.yfanefa.com/news/53znews-53zMemory Bank:  Bradford Launch)r   r   r   r   z1https://www.yfanefa.com/evaluating_nature_mattersevaluating_nature_matterszEvaluating Nature Mattersc                 C   s   |  |}| ||}| d|d|}g }t|d |ddd}t|dkr1| j||dd	d
}n|ddg}|ddd| j	|d dpMt
| |d|dt|dthfdthfdS )Nz!iwPlayer\.options\["[\w.]+"\]\s*=zplayer optionsr   	signature )delimm3u8r   hls)m3u8_id)r   r   /-)defaultz | Yorkshire Film Archive)r   r   formatspreviewr   )r   r   )	_match_id_download_webpage_search_jsonr   getr   _extract_m3u8_formatsstripreplace_og_search_titler   _html_extract_titler	   r   r   )selfr   video_idwebpageplayer_datar   	video_url r.   L/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/yfanefa.py_real_extract*   s,   
zYfanefaIE._real_extractN)__name__
__module____qualname__IE_NAME
_VALID_URL_TESTSr0   r.   r.   r.   r/   r
      s6    
	r
   N)commonr   utilsr   r   r   r   r   utils.traversalr	   r
   r.   r.   r.   r/   <module>   s    