o
    i                     @   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.htmhwy50at24thtsz#US-50 : Sacramento : Hwy 50 at 24this_livezGhttps://cwwp2.dot.ca.gov/data/d3/cctv/image/hwy50at24th/hwy50at24th.jpg)idexttitlelive_status	thumbnail)url	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)livez : )r   r	   r   formatsr   )	_match_id_download_webpage_search_regex_extract_m3u8_formats)
selfr   video_idwebpageglobal_varsroute_placelocation_name
poster_urlvideo_streamr    r   M/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/caltrans.py_real_extract   s"   
zCaltransIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTr   r   r   r   r   r      s    r   N)commonr   r   r   r   r   r   <module>   s    