o
    i                     @   s<   d dl mZ d dlmZ ddlmZmZ G dd deZdS )   )BrightcoveNewIE)InfoExtractor   )ExtractorErrortraverse_objc                   @   s   e Zd ZdZdZdZdddddd	d
ddddddddd
igddddddi dddddddeddd d!d"d#d$d%d&d'd(d)d*d'd+d#d,ed-d.d/d0d1ed2d3gd4d5d6d7d8d9igdd:d;d<dd=d>d?d7d@gZdAZdBdC Z	dDS )EOneNewsNZIE1Newsz1news.co.nz article videoszEhttps?://(?:www\.)?(?:1|one)news\.co\.nz/\d+/\d+/\d+/(?P<id>[^/?#&]+)z\https://www.1news.co.nz/2022/09/29/cows-painted-green-on-parliament-lawn-in-climate-protest/z8cows-painted-green-on-parliament-lawn-in-climate-protestz:'Cows' painted green on Parliament lawn in climate protest)idtitle	info_dict6312993358112zMActivists dressed as cows painted green outside Parliament in climate protestmp4zcount:6963482464001i4c20220929gA`"C@zre:^https?://.*\.jpg$zUGreenpeace accused the Government of "greenwashing" instead of taking climate action.)
r	   r
   exttagsuploader_id	timestampupload_dateduration	thumbnaildescription)urlr   playlistzNhttps://www.1news.co.nz/2022/09/30/now-is-the-time-to-care-about-womens-rugby/z*now-is-the-time-to-care-about-womens-rugbyz+Now is the time to care about women's rugbyr	   s4wEB9neTfUr
   u4   Why I love women’s rugby: Black Fern Ruahei Demantr   channel_follower_countchannel_urlz8https://www.youtube.com/channel/UC2BQ3U9IxoYIJyulv0bN5PQr   zcount:12uploaderzRe: Newsr   20211215r   UC2BQ3U9IxoYIJyulv0bN5PQuploader_urlz7http://www.youtube.com/channel/UC2BQ3U9IxoYIJyulv0bN5PQ
channel_idchannel
like_countr   z4https://i.ytimg.com/vi/s4wEB9neTfU/maxresdefault.jpg	age_limit    
view_count
categoriesSports   z$md5:8874410e5740ed1d8fd0df839f849813publicTnot_live)r   r   availabilityplayable_in_embedlive_statusz^https://www.1news.co.nz/2022/09/29/raw-videos-capture-hurricane-ians-fury-as-it-slams-florida/z:raw-videos-capture-hurricane-ians-fury-as-it-slams-floridaz;Raw videos capture Hurricane Ian's fury as it slams Floridar   )r   r   playlist_mincountz^https://www.onenews.co.nz/2022/09/29/cows-painted-green-on-parliament-lawn-in-climate-protest/)r   only_matchingzHhttp://players.brightcove.net/%s/0xpHIR6IB_default/index.html?videoId=%sc                 C   s   |  |}| ||}| d|d|}g }t|dpg D ]?}t|d}|dkrEt|d}| jt|dp4dt|d	f }	|| |	t q|d
kr[t|dd}
|
r[|| j|
dd q|sdtdddt|dpn| 	d|}| 
|||S )NzFusion\.globalContent\s*=zfusion metadatacontent_elementssubtypevideo)embedconfigbrightcoveAccountr   brightcoveVideoIdyoutube)referentr	   )
raw_oembed_idYoutube)iez#This article does not have a video.T)expected)	headlinesbasic )	_match_id_download_webpage_search_jsonr   BRIGHTCOVE_URL_TEMPLATEappend
url_resultr   r   _generic_titleplaylist_result)selfr   
display_idwebpagefusion_metadataentriesitem	item_typebrightcove_configbrightcove_urlvideo_id_or_urlplaylist_title rU   N/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/onenewsnz.py_real_extractO   s0   




zOneNewsNZIE._real_extractN)
__name__
__module____qualname__IE_NAMEIE_DESC
_VALID_URLint_TESTSrE   rW   rU   rU   rU   rV   r      s    	
#	Cr   N)
brightcover   commonr   utilsr   r   r   rU   rU   rU   rV   <module>   s    