U
    Mf                     @   s@   d dl mZ ddlmZmZmZmZmZmZ G dd deZ	dS )   )InfoExtractor   )ExtractorErrorint_or_noneparse_age_limitparse_iso8601smuggle_urlstr_or_nonec                   @   s   e Zd ZdZdddddddd	d
ddddddiddddddddddddddddd d!d"d#ddid$d%dd&d'dd&d(dd&gZd)d* Zd+S ),CWTVIEzhttps?://(?:www\.)?cw(?:tv(?:pr)?|seed)\.com/(?:shows/)?(?:[^/]+/)+[^?]*\?.*\b(?:play|watch)=(?P<id>[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})z[http://cwtv.com/shows/arrow/legends-of-yesterday/?play=6b15e985-9345-4f60-baf8-56e96be57c63z$6b15e985-9345-4f60-baf8-56e96be57c63Zmp4zLegends of YesterdayzOliver and Barry Allen take Kendra Saunders and Carter Hall to a remote location to keep them hidden from Vandal Savage while they figure out how to defeat him.ii
  ZArrow   4   Z20151203i4_V)idexttitledescriptiondurationseriesseason_numberseasonepisode_numberupload_date	timestampZskip_downloadTz(redirect to http://cwtv.com/shows/arrow/)url	info_dictparamsskipzkhttp://www.cwseed.com/shows/whose-line-is-it-anyway/jeff-davis-4/?play=24282b12-ead2-42f2-95ad-26770c2c6088z$24282b12-ead2-42f2-95ad-26770c2c6088zJeff Davis 4z%Jeff Davis is back to make you laugh.i  zWhose Line Is It Anyway?      Z20151006i$TV   ZCWTVzre:^https?://.*\.jpe?g$zcount:4z
Episode 20z	Season 11)r   r   r   r   r   r   r   r   r   r   	age_limitZuploader	thumbnailZchaptersepisoder   )r   r   r   zRhttp://cwtv.com/thecw/chroniclesofcisco/?play=8adebe35-f447-465f-ab52-e863506ff6d6)r   Zonly_matchingzIhttp://cwtvpr.com/the-cw/video?watch=9eee3f60-ef4e-440b-b3b2-49428ac9c54ez\http://cwtv.com/shows/arrow/legends-of-yesterday/?watch=6b15e985-9345-4f60-baf8-56e96be57c63c           	      C   s   |  |}| d| |}|ddkr8t|d dd|d }|d }|d	p\d
| d}t|d}t|d}|r|r|t|d  }d||t|ddi|dt|d|dt|t|t|dt	|dd|ddS )NzChttp://images.cwtv.com/feed/mobileapp/video-meta/apiversion_8/guid_resultokmsgT)expectedvideor   mpx_urlz9http://link.theplatform.com/s/cwtv/media/guid/2703454149/z?formats=M3Ur   r"   Zurl_transparentZforce_smil_urlZdescription_longZduration_secsZseries_name
start_timeZratingZThePlatformZlarge_thumbnail)_typer   r   r   r   r   r   r   r   r   r    Zie_keyr!   )
Z	_match_idZ_download_jsongetr   r	   lenr   r   r   r   )	selfr   Zvideo_iddataZ
video_datar   r(   r   r"    r/   9/tmp/pip-unpacked-wheel-zk9bgjdq/yt_dlp/extractor/cwtv.py_real_extractE   s8    
zCWTVIE._real_extractN)__name__
__module____qualname__Z
_VALID_URLZ_TESTSr1   r/   r/   r/   r0   r
      sh     7r
   N)
commonr   utilsr   r   r   r   r   r	   r
   r/   r/   r/   r0   <module>   s    
