
    VGh                     B    d dl mZ d dlmZ ddlmZmZ  G d de      Zy)   )BrightcoveNewIE)InfoExtractor   )ExtractorErrortraverse_objc                       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dB Z	yC)D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                 j   | j                  |      }| j                  ||      }| j                  d|d|      }g }t        |d      xs g D ]  }t        |d      }|dk(  r[t        |d      }| j                  t        |d      xs dt        |d	      fz  }	|j                  | j                  |	t                     o|d
k(  sut        |dd      }
|
s|j                  | j                  |
d              |st        dd      t        |d      xs | j                  d|      }| j                  |||      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_titles               c/var/www/it7/html/youtubeDownloader/venv/lib/python3.12/site-packages/yt_dlp/extractor/onenewsnz.py_real_extractzOneNewsNZIE._real_extractO   sR   ^^C(
((j9++,H'Sdfpq 2DEK 	SD$T95IG#$07J$K!!%!=!= !24GHZN !24GHA " t~OPi'".t5GI^"_"NN4???y?#QR	S  !FQUVV *@A 0""2w/ 	 ##GZHH    N)
__name__
__module____qualname__IE_NAMEIE_DESC
_VALID_URLint_TESTSrH   rY    rZ   rX   r	   r	      s   G*GYJ rPW
 )l %#1!+#- &!9#z 	
, dBG
  -S 5 -c	
 "#] J 
 ": "#= #$] !"< z !#  !W    !#!" !8*#$ !$#I$,)-#-- !
F tRW "#
 t!
}AFF iIrZ   r	   N)
brightcover   commonr   utilsr   r   r	   rc   rZ   rX   <module>rg      s    ' ! 0eI- eIrZ   