U
    g(                     @   s0   d dl mZ ddlmZmZ G dd deZdS )   )InfoExtractor   )
js_to_jsonmerge_dictsc                   @   s>   e Zd ZdZdddddddd	d
dd	ddidgZdd ZdS )NewsyIEz7https?://(?:www\.)?newsy\.com/stories/(?P<id>[^/?#$&]+)zIhttps://www.newsy.com/stories/nft-trend-leads-to-fraudulent-art-auctions/Z609d65125b086c24fb529312Zmp4z&NFT Art Auctions Have A Piracy Problemz$md5:971e52ab8bc97e50305475cde8284c83z*nft-trend-leads-to-fraudulent-art-auctionsi@`i. z;https://cdn.newsy.com/images/videos/x/1620927824_xyrrP4.jpgZ20210518)	idexttitledescription
display_id	timestampduration	thumbnailZupload_dateZskip_downloadT)urlZ	info_dictparamsc           
   
   C   s   |  |}| ||}| | d|d|t}| j||dd}g i  }}|dr|| |d |\}}	|| | 	||	}t
||d ||d|d|d	||d
S )Nz$data-video-player\s?=\s?"({[^"]+})">dataF)fatalstreamr   Zheadliner   image)r   r   r	   r   r   formats	subtitles)Z	_match_idZ_download_webpageZ_parse_jsonZ_html_search_regexr   Z_search_json_ldgetZ#_extract_m3u8_formats_and_subtitlesextendZ_merge_subtitlesr   )
selfr   r   ZwebpageZ	data_jsonZld_jsonr   r   Zfmtssubs r   :/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/newsy.py_real_extract   s2    
   


zNewsyIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTSr   r   r   r   r   r      s   r   N)commonr   utilsr   r   r   r   r   r   r   <module>   s   