U
    g                     @   s8   d dl mZ ddlmZ ddlmZ G dd deZdS )   )InfoExtractor   )url_or_none)traverse_objc                	   @   s6   e Zd ZdZdddddddd	d
gddZdd ZdS )SenIEz4https?://(?:www\.)?sen\.com/video/(?P<id>[0-9a-f-]+)z>https://www.sen.com/video/eef46eb1-4d79-4e28-be9d-bd937767f8c4Z ff615aca9691053c94f8f10d96cd7884z$eef46eb1-4d79-4e28-be9d-bd937767f8c4mp4zFlorida, 28 Sep 2022zHurricane IanzNorth AmericaZStormZWeather)idextdescriptiontitletags)urlmd5Z	info_dictc                 C   s   |  |}| d| |}t|dddd ddthtfpDd| d	}|| ||d
dt|dddd tdddthfdddthfdddthfdfS )Nz)https://api.sen.com/content/public/video/dataZnodesc                 S   s   |d dkS )Nr   Zplayer _vr   r   8/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/sen.py<lambda>       z%SenIE._real_extract.<locals>.<lambda>videor   zhttps://vod.sen.com/videos/z/manifest.m3u8r   )r   formatsc                 S   s   |d dkS )Nr   detailsr   r   r   r   r   r      r   contentr   textZdescriptions    Zbadges.)r   r
   r   )Z	_match_idZ_download_jsonr   r   anyZ_extract_m3u8_formatsstr)selfr   Zvideo_idZapi_dataZm3u8_urlr   r   r   _real_extract   s,    
      

zSenIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTr    r   r   r   r   r      s   r   N)commonr   utilsr   Zutils.traversalr   r   r   r   r   r   <module>   s   