o
    i8                     @   sh   d dl Z d dlZddlmZ ddlmZ ddlmZmZm	Z	m
Z
mZ G dd deZG d	d
 d
eZdS )    N   )InfoExtractor)JWPlatformIE   )ExtractorErrorOnDemandPagedListextract_attributesget_element_by_classget_element_html_by_classc                
   @   s<   e Zd ZdZdddddddd	d
dddidgZdd ZdS )HollywoodReporterIEz>https?://(?:www\.)?hollywoodreporter\.com/video/(?P<id>[\w-]+)zhttps://www.hollywoodreporter.com/video/chris-pine-michelle-rodriguez-dungeons-dragons-cast-directors-on-what-it-took-to-make-film-sxsw-2023/zH4jZaR5mp4z$md5:a9a1c073770a32f178955997712c4bd9z^The cast and directors of 'Dungeons & Dragons: Honor Among Thieves' talk about their new film.z?https://cdn.jwplayer.com/v2/media/zH4jZaR5/poster.jpg?width=72020230312i72dg     @n@)idexttitledescription	thumbnailupload_date	timestampdurationskip_downloadm3u8)url	info_dictparamsc                 C   sv   |  |}| ||}ttd|pd}|d }|d }|dkr)| d| tS |dkr3| |dS td	| d
)Nzvlanding-video-card__link zdata-video-showcase-triggerzdata-video-showcase-typejwplayerzjwplatform:youtubeYoutubezUnsupported showcase type "")	_match_id_download_webpager   r
   
url_resultr   r   )selfr   
display_idwebpagedatavideo_idshowcase_type r*   V/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/hollywoodreporter.py_real_extract    s   
z!HollywoodReporterIE._real_extractN)__name__
__module____qualname__
_VALID_URL_TESTSr,   r*   r*   r*   r+   r      s    
r   c                   @   s4   e Zd ZdZddddddgZdd	 Zd
d ZdS )HollywoodReporterPlaylistIEzPhttps?://(?:www\.)?hollywoodreporter\.com/vcategory/(?P<slug>[\w-]+)-(?P<id>\d+)zHhttps://www.hollywoodreporter.com/vcategory/heat-vision-breakdown-57822/m   57822zheat-vision-breakdown)r   r   )r   playlist_mincountr   c                 c   sf    |d7 }| j d| d| d| d|d| d}td|p d	}td
|D ]	}| |tV  q'd S )Nr   z,https://www.hollywoodreporter.com/vcategory/-z/page//zDownloading playlist page )notezvideo-playlist-riverr   z.<a[^>]+href="([^"]+)"[^>]+class="c-title__link)r"   r	   refindallr#   r   )r$   slugpl_idpager&   sectionr   r*   r*   r+   _fetch_page;   s   
z'HollywoodReporterPlaylistIE._fetch_pagec                 C   s6   |  |dd\}}| tt| j||d||S )Nr;   r      )_match_valid_urlgroupplaylist_resultr   	functoolspartialr?   )r$   r   r;   r<   r*   r*   r+   r,   E   s   z)HollywoodReporterPlaylistIE._real_extractN)r-   r.   r/   r0   r1   r?   r,   r*   r*   r*   r+   r2   0   s    	
r2   )rD   r9   commonr   
jwplatformr   utilsr   r   r   r	   r
   r   r2   r*   r*   r*   r+   <module>   s    	!