U
    g                     @   sD   d dl Z ddlmZ ddlmZ G dd deZG dd	 d	eZdS )
    N   )InfoExtractor   )traverse_objc                	   @   sN   e Zd ZdZdZdgZdddddd	d
dddddddddgZdd ZdS )WashingtonPostIEZwashingtonpostz(?:washingtonpost:|https?://(?:www\.)?washingtonpost\.com/(?:video|posttv)/(?:[^/]+/)*)(?P<id>[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})z<iframe[^>]+\bsrc=["\'](?P<url>https?://(?:www\.)?washingtonpost\.com/video/c/embed/[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12})zQhttps://www.washingtonpost.com/video/c/video/480ba4ee-1ec7-11e6-82c2-a7dcb313287dZ 6f537e1334b714eb15f9563bd4b9cdfaz$480ba4ee-1ec7-11e6-82c2-a7dcb313287dmp4z/Egypt finds belongings, debris from plane crashz$md5:a17ceee432f215a5371388c1f680bd86Z20160520io?W)idexttitledescriptionupload_date	timestamp)urlmd5	info_dictzhttps://www.washingtonpost.com/video/world/egypt-finds-belongings-debris-from-plane-crash/2016/05/20/480ba4ee-1ec7-11e6-82c2-a7dcb313287d_video.htmlTr   Zonly_matchingzhttps://www.washingtonpost.com/posttv/world/iraq-to-track-down-antiquities-after-islamic-state-museum-rampage/2015/02/28/7c57e916-bf86-11e4-9dfb-03366e719af8_video.htmlc                 C   s   |  |}| d| d|S )Nzarcpublishing:wapo:ZArcPublishing)	_match_id
url_result)selfr   Zvideo_id r   C/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/washingtonpost.py_real_extract   s    
  zWashingtonPostIE._real_extractN)__name__
__module____qualname__IE_NAME
_VALID_URLZ_EMBED_REGEX_TESTSr   r   r   r   r   r      s*   r   c                       s   e Zd ZdZdZddddddd	d
dddddddddd	ddddddddgdddddddd	dd d!d"d#dgd$d%d&d'd(gZe fd)d*Zd+d, Z  Z	S )-WashingtonPostArticleIEzwashingtonpost:articlezAhttps?://(?:www\.)?washingtonpost\.com/(?:[^/]+/)*(?P<id>[^/?#]+)zMhttp://www.washingtonpost.com/sf/national/2014/03/22/sinkhole-of-bureaucracy/zsinkhole-of-bureaucracyzSinkhole of bureaucracy)r   r
   Z 7ccf53ea8cbb77de5f570242b3b21a59z$fc433c38-b146-11e3-b8b3-44b1d1cd4c1fr   zBreaking Points: The Paper Minei
  zOverly complicated paper pushing is nothing new to government bureaucracy. But the way federal retirement applications are filed may be the most outdated. David Fahrenthold explains.i ,SZ20140321z6re:https://[^\.]+.cloudfront\.net/PAPERMINESplash\.jpg)r   r	   r
   durationr   r   r   	thumbnail)r   r   z$41255e28-b14a-11e3-b8b3-44b1d1cd4c1fzThe town bureaucracy sustainsa  Underneath the friendly town of Boyers is a sea of government paperwork. In a disused limestone mine, hundreds of locals now track, file and process retirement applications for the federal government. We set out to find out what it's like to do paperwork 230 feet underground.i  i,Sz4re:https://[^\.]+.cloudfront\.net/BoyersSplash\.jpeg)r   r	   r
   r   r   r   r   r    )r   r   playlistzhttp://www.washingtonpost.com/blogs/wonkblog/wp/2014/12/31/one-airline-figured-out-how-to-make-sure-its-airplanes-never-disappear/zFone-airline-figured-out-how-to-make-sure-its-airplanes-never-disappearzFOne airline figured out how to make sure its airplanes never disappearZ a7c1b5634ba5e57a6a82cdffa5b1e0d0z$0e4bb54c-9065-11e4-a66f-0ca5037a597dzWashington Post transportation reporter Ashley Halsey III explains why a plane's black box needs to be recovered from a crash site instead of having its information streamed in real time throughout the flight.Z20141230iZTu2   Why black boxes don’t transmit data in real time)r   r	   r   r   r   r
   zDoesnt have a video anymore)r   r   r!   skipzUhttps://www.washingtonpost.com/nation/2021/08/05/dixie-river-fire-california-climate/Tr   c                    s   t |rdS t |S )NF)r   suitablesuper)clsr   	__class__r   r   r#   ]   s    z WashingtonPostArticleIE.suitablec           	         s     |} ||} |}td|}|sj ||}t|dD ]"}|ddkrF||d qF fdd|D }d|||d	S )
Nz(?x)
            (?:
                <div\s+class="posttv-video-embed[^>]*?data-uuid=|
                data-video-uuid=
            )"([^"]+)")propsZ	pagePropsZglobalContentZcontent_elementstypevideoZ_idc                    s    g | ]}  d | d|qS )zwashingtonpost:ZWashingtonPost)r   ).0uuidr   r   r   
<listcomp>s   s     z9WashingtonPostArticleIE._real_extract.<locals>.<listcomp>r!   )_typeentriesr   r
   )	r   Z_download_webpageZ_og_search_titlerefindallZ_search_nextjs_datar   getappend)	r   r   Zpage_idZwebpager
   ZuuidsZ	json_dataZcontent_elementr0   r   r-   r   r   a   s"    

z%WashingtonPostArticleIE._real_extract)
r   r   r   r   r   r   classmethodr#   r   __classcell__r   r   r&   r   r   $   sh    6r   )r1   commonr   utilsr   r   r   r   r   r   r   <module>   s   