U
    g                      @   s4   d dl Z ddlmZ ddlmZ G dd deZdS )    N   )InfoExtractor   )extract_attributesc                   @   sT   e 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gdgZdd ZdS )BostonGlobeIEzG(?i)https?://(?:www\.)?bostonglobe\.com/.*/(?P<id>[^/]+)/\w+(?:\.html)?zhttp://www.bostonglobe.com/metro/2017/02/11/tree-finally-succumbs-disease-leaving-hole-neighborhood/h1b4lviqzMTIn9sVy8F3gP/story.htmlZ 0a62181079c85c2d2b618c9a738aedafzDA tree finally succumbs to disease, leaving a hole in a neighborhoodZ5320421710001Zmp4zIt arrived as a sapling when the Back Bay was in its infancy, a spindly American elm tamped down into a square of dirt cut into the brick sidewalk of 1880s Marlborough Street, no higher than the first bay window of the new brownstone behind it.iXZ20170212Z	245991542)titleidextdescription	timestampupload_dateuploader_id)urlmd5	info_dictzhttps://www.bostonglobe.com/lifestyle/names/2017/02/17/does-ben-affleck-play-matt-damon-favorite-version-batman/ruqkc9VxKBYmh5txn1XhSI/story.htmlZ 582b40327089d5c0c949b3c54b13c24bz$Who Is Matt Damon's Favorite Batman?ZZW1QCnlA6QcZ20170217z$md5:3b3dccb9375867e0b4d527ed87d307cbz$The Late Late Show with James CordenZTheLateLateShow)r   r   r	   r   r
   Zuploaderr   Z404)r   r   r   Zexpected_warningsc                 C   s   |  |}| ||}| j|d d}g }td|D ]f}t|}|d}|d}	|d}
|d}|r4|	r4|
r4|r4|d|	 d|
 d	| d
|  q4t|dkr| 	|dS t|dkr| 	|d dS | j
|||ddS d S )N)defaultz(?i)(<video[^>]+>)zdata-brightcove-video-idzdata-accountzdata-playerz
data-embedzhttp://players.brightcove.net//_z/index.html?videoId=r   Genericr   ZBrightcoveNew)Zie)Z	_match_idZ_download_webpageZ_og_search_titlerefindallr   getappendlenZ
url_resultZplaylist_from_matches)selfr   Zpage_idZwebpageZ
page_titleentriesvideoattrsZvideo_idZ
account_idZ	player_idembed r   @/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/bostonglobe.py_real_extract*   s&    




zBostonGlobeIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTSr!   r   r   r   r    r   	   s4   	r   )r   commonr   utilsr   r   r   r   r   r    <module>   s   