
    yfc                     6    d dl mZ ddlmZmZ  G d de      Zy)   )InfoExtractor   )try_getunified_timestampc                   `    e Zd ZdZdddddddd	gd
ddiddddddddgdgddd	ddidgZd Zy)CGTNIEzhhttps?://news\.cgtn\.com/news/[0-9]{4}-[0-9]{2}-[0-9]{2}/[a-zA-Z0-9-]+-(?P<id>[a-zA-Z0-9-]+)/index\.htmlzghttps://news.cgtn.com/news/2021-03-09/Up-and-Out-of-Poverty-Ep-1-A-solemn-promise-YuOUaOzGQU/index.html
YuOUaOzGQUmp4z-Up and Out of Poverty Ep. 1: A solemn promisezre:^https?://.*\.jpg$iuG`20210309Video)idexttitle	thumbnail	timestampupload_date
categoriesskip_downloadT)url	info_dictparamszwhttps://news.cgtn.com/news/2021-06-06/China-Indonesia-vow-to-further-deepen-maritime-cooperation-10REvJCewCY/index.html10REvJCewCYz;China, Indonesia vow to further deepen maritime cooperationzre:^https?://.*\.png$zChina and Indonesia vowed to upgrade their cooperation into the maritime sector and also for political security, economy, and cultural and people-to-people exchanges.CGTNChinai8A`20210606)	r   r   r   r   descriptioncreatorsr   r   r   Fc                    | j                  |      }| j                  ||      }| j                  d|d      }| j                  d|dd      }| j                  d|dd      }| j                  d	|d
d       }|| j	                  |      | j                  |d       | j                  |      | j                  ||ddd      |r|gnd |r|gnd t        t        |      d       dS )Nzdata-video ="(?P<url>.+m3u8)"download_urlz%<span class="date">\s*(.+?)\s*</span>datetime_strF)fatalz(<span class="section">\s*(.+?)\s*</span>categoryz/<div class="news-author-name">\s*(.+?)\s*</div>author)defaultr
   m3u8_nativehls)m3u8_idc                     | dz
  S )Nip   )xs    7/usr/lib/python3/dist-packages/yt_dlp/extractor/cgtn.py<lambda>z&CGTNIE._real_extract.<locals>.<lambda>@   s    APXL     )r   r   r   r   formatsr   r   r   )
	_match_id_download_webpage_html_search_regex_search_regex_og_search_title_og_search_description_og_search_thumbnail_extract_m3u8_formatsr   r   )selfr   video_idwebpager   r    r"   r#   s           r+   _real_extractzCGTNIE._real_extract,   s   >>#&((h7../OQXZhi..4g~UZ / \**7*TY + [##>[_ $ a **7366w6M227;11,%Q^hm1n(08*d$* !2<!@BXY	
 		
r-   N)__name__
__module____qualname__
_VALID_URL_TESTSr:   r)   r-   r+   r   r      s    |J }"H5')&i  	
 M#V5  H#H&i')
  
 FD
r-   r   N)commonr   utilsr   r   r   r)   r-   r+   <module>rB      s    !9
] 9
r-   