U
    g                     @   s(   d dl Z ddlmZ G dd deZdS )    N   )InfoExtractorc                
   @   sl   e Zd ZdZdZddddddd	d
dddiddddddddd
dddidddddddgZdd ZdS )CloserToTruthIEFzAhttps?://(?:www\.)?closertotruth\.com/(?:[^/]+/)*(?P<id>[^/?#&]+)zJhttp://closertotruth.com/series/solutions-the-mind-body-problem#video-3688Z
0_zof1ktrezsolutions-the-mind-body-problemZmovz#Solutions to the Mind-Body Problem?Z20140221igSZCTTXML)id
display_idexttitleZupload_date	timestampZuploader_idZskip_downloadT)url	info_dictparamsz4http://closertotruth.com/episodes/how-do-brains-workZ
0_iuxai6g6zhow-do-brains-workzHow do Brains Work?ixSz(http://closertotruth.com/interviews/1725Z1725z	AyaFr-002)r   r      )r
   r   Zplaylist_mincountc              	   C   s   |  |}| ||}| d|d}| |d}| jd|dd d}|rt }g }td|D ]H}	|	d}
|
|krtq\||
 |	d	d
| d|
 d|	dd q\|r| 
|||S | jd|ddd}
d	|d
| d|
 d|dS )Nz0<script[^>]+src=["\'].*?\b(?:partner_id|p)/(\d+)zkaltura partner_idzvideo titlez7(?s)<select[^>]+id="select-version"[^>]*>(.+?)</select>zselect version)defaultzL<option[^>]+value=(["\'])(?P<id>[0-9a-z_]+)(?:#.+?)?\1[^>]*>(?P<title>[^<]+)r   Zurl_transparentzkaltura::ZKalturar   )_typer
   ie_keyr   zM<a[^>]+id=(["\'])embed-kaltura\1[^>]+data-kaltura=(["\'])(?P<id>[0-9a-z_]+)\2zkaltura entry_id)group)r   r   r
   r   r   )Z	_match_idZ_download_webpageZ_search_regexZ_html_extract_titlesetrefinditerr   addappendZplaylist_result)selfr
   r   ZwebpageZ
partner_idr   selectZ	entry_idsentriesZmobjZentry_id r   B/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/closertotruth.py_real_extract.   sZ    
   


  zCloserToTruthIE._real_extractN)__name__
__module____qualname__Z_WORKINGZ
_VALID_URLZ_TESTSr   r   r   r   r   r      sH   
 
 %r   )r   commonr   r   r   r   r   r   <module>   s   