U
    $Pf
                     @   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   )
xpath_textparse_durationExtractorErrorc                	   @   s6   e Zd ZdZdddddddd	d
dZdZdd ZdS )	EyedoTVIEzEhttps?://(?:www\.)?eyedo\.tv/[^/]+/(?:#!/)?Live/Detail/(?P<id>[0-9]+)z/https://www.eyedo.tv/en-US/#!/Live/Detail/16301Z ba14f17995cdfc20c36ba40e21bf73f7Z16301mp4u0   Journée du conseil scientifique de l'Afnic 2015z$md5:4abe07293b2f73efc6e1c37028d58c98z
Afnic LiveZ8023)idexttitledescriptionuploaderuploader_id)urlmd5Z	info_dictzhttp://live.eyedo.net:1935/c           	         s    |} d| |} fdd}t||ddd}t||ddd}|dkrdtd	 j dd
|dk}d }|rt|ddkrd| }q jd|  }n jd||f  }|| ||ddt||dtt||dt||dt||dt||dt||dd	S )Nz#http://eyedo.tv/api/live/GetLive/%sc                    s     | dS )NzThttp://schemas.datacontract.org/2004/07/EyeDo.Core.Implementation.Web.ViewModels.Api)Z	_xpath_ns)pathself @/tmp/pip-unpacked-wheel-7zdooeg3/youtube_dl/extractor/eyedotv.py_add_ns    s    z(EyedoTVIE._real_extract.<locals>._add_nsZTitrer   TZStateLiveCodeZavenirz:%s said: We're sorry, but this video is not yet available.)expectedZliveZCdntruezjhttp://rrr.sz.xlcdn.com/?account=eyedo&file=A%s&type=live&service=wowza&protocol=http&output=playlist.m3u8zw/%s/eyedo_720p/playlist.m3u8z$replay-w/%s/mp4:%s.mp4/playlist.m3u8r
   Zm3u8_nativeDescriptionZDurationZCreateurZ
CreateurIdZChapitreTitreZ
ChapitreId)	r   r   formatsr   durationr   r   ZchapterZ
chapter_id)Z	_match_idZ_download_xmlr   r   ZIE_NAME	_ROOT_URLZ_extract_m3u8_formatsr   )	r   r   Zvideo_idZ
video_datar   r   Zstate_live_codeZis_liveZm3u8_urlr   r   r   _real_extract   s@    

   zEyedoTVIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTr   r   r   r   r   r   r	      s   r	   N)	
__future__r   commonr   utilsr   r   r   r	   r   r   r   r   <module>   s   