U
    g
                     @   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   )ExtractorErrordetermine_extstr_or_noneunified_timestampurl_or_none)traverse_objc                   @   sV   e Zd ZdZdddeddddd	d
d	ddddddedddddd	dgZdd ZdS )GodResourceIEz0https?://new\.godresource\.com/video/(?P<id>\w+)z-https://new.godresource.com/video/A01mTKjyf6wZA01mTKjyf6wmp4ijve5zQhttps://cdn-02.godresource.com/e42968ac-9e8b-4231-ab86-f4f9d775841f/thumbnail.jpgzStedfast Baptist ChurchZ20240320zGodResource video #A01mTKjyf6w)	idext
view_count	timestamp
channel_id	thumbnailchannelupload_datetitle)url	info_dictz-https://new.godresource.com/video/01DXmBbQv_XZ 0e8f72aa89a106b9d5c011ba6f8717b7Z01DXmBbQv_XZ12iɜdz>https://cdn-02.godresource.com/sodomitedeception/thumbnail.jpgZDocumentarieszThe Sodomite DeceptionZ20230629)	r   r   r   r   r   r   r   r   r   )r   md5r   c           	      C   s   |  |}| d| |}|d }|dp0d}t| }dkrX| j|||d\}}n*|dkrt||dgi  }}ntd	| |||d
|dt|dthfdthfdt	hfdthfdt
hfdthfdthfdS )Nz(https://api.godresource.com/api/Streams/Z	streamUrlZisLiveFZm3u8)Zliver   )r   r   zUnexpected video format  )r   formats	subtitlesr   is_liver   r   ZviewsZchannelNameZ	channelIdZstreamDateCreatedZstreamDataModified)r   r   r   r   r   r   Zmodified_timestamp)Z	_match_idZ_download_jsongetr   Z#_extract_m3u8_formats_and_subtitlesr   r	   strr   intr   r   )	selfr   Z
display_idZapi_dataZ	video_urlr   r   r   r    r!   @/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/godresource.py_real_extract-   sH    
   zGodResourceIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLr   Z_TESTSr#   r!   r!   r!   r"   r
      s8   r
   N)commonr   utilsr   r   r   r   r   Zutils.traversalr	   r
   r!   r!   r!   r"   <module>   s   