U
    g                     @   s    d dl mZ G dd deZdS )   )InfoExtractorc                   @   s.   e Zd ZdZdddddddd	Zd
d ZdS )
CaltransIEzAhttps?://(?:[^/]+\.)?ca\.gov/vm/loc/[^/]+/(?P<id>[a-z0-9_]+)\.htmz2https://cwwp2.dot.ca.gov/vm/loc/d3/hwy50at24th.htmZhwy50at24thtsz#US-50 : Sacramento : Hwy 50 at 24this_livezGhttps://cwwp2.dot.ca.gov/data/d3/cctv/image/hwy50at24th/hwy50at24th.jpg)idexttitleZlive_status	thumbnail)urlZ	info_dictc           
      C   s   |  |}| ||}| d|d}| jd|ddd}| jd|ddd}| jd	|d
dd}| jd|ddd}| j||ddd}	|| d| d|	|dS )Nz(<script[^<]+?([^<]+\.m3u8[^<]+)</script>zGlobal VarszroutePlace\s*=\s*"([^"]+)"zRoute PlaceF)fatalzlocationName\s*=\s*"([^"]+)"zLocation NamezposterURL\s*=\s*"([^"]+)"z
Poster UrlzvideoStreamURL\s*=\s*"([^"]+)"zVideo Stream URLr   T)Zlivez : )r   r   r   formatsr	   )Z	_match_idZ_download_webpageZ_search_regexZ_extract_m3u8_formats)
selfr
   Zvideo_idZwebpageglobal_varsZroute_placeZlocation_nameZ
poster_urlZvideo_streamr    r   =/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/caltrans.py_real_extract   s$    
 zCaltransIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTr   r   r   r   r   r      s   r   N)commonr   r   r   r   r   r   <module>   s   