U
    g                     @   sT   d dl mZ d dlmZ ddlmZmZmZmZ G dd deZ	G dd deZ
d	S )
   )AMPIE)InfoExtractor   )ExtractorErrorint_or_noneparse_iso8601str_or_nonec                   @   s^   e Zd ZdZdZddddddd	d
dddddddddddddddddgdgZdd ZdS ) BleacherReportIEFz;https?://(?:www\.)?bleacherreport\.com/articles/(?P<id>\d+)zyhttp://bleacherreport.com/articles/2496438-fsu-stat-projections-is-jalen-ramsey-best-defensive-player-in-college-footballZ a3ffc3dc73afdbc2010f02d98f990f20Z2496438mp4zPFSU Stat Projections: Is Jalen Ramsey Best Defensive Player in College Football?Z3992341zCFB, ACC, Florida Statei~UZ20150615zTeam Stream Now )idexttitleuploader_iddescription	timestampupload_dateuploaderzVideo removed)urlmd5	info_dictskipzxhttp://bleacherreport.com/articles/2586817-aussie-golfers-get-fright-of-their-lives-after-being-chased-by-angry-kangarooZ 6a5cd403418c7b01719248ca97fb0692Z2586817ZwebmzMAussie Golfers Get Fright of Their Lives After Being Chased by Angry Kangarooi=VzSean Fayz$md5:b1601e2314c4d8eec23b6eafe086a757Z6466954Z20151011)r   r   r   r   r   r   r   r   ZYoutube)r   r   r   Zadd_iec           	      C   s.  |  |}| d| |d }g }|d}|rP|d |d|ddg}d||d	 |d
i dt|dt|d|t|dt|dd	}|d}|r|d }|dkrd|d |d< nD|dkr|d |d< n.|dkr
d|d |d< n||d  |d< |S tdddd S )Nz.http://api.bleacherreport.com/api/v1/articles/articleZprimaryPhotor   widthheight)r   r   r   Zurl_transparentr   authornameZauthorIdZ	createdAtZcommentsCountZhitCount)	_typer   r   r   r   r   
thumbnailsZcomment_countZ
view_countvideotype)zcms.bleacherreport.comzvid.bleacherreport.comz+http://bleacherreport.com/video_embed?id={}r   zyoutube.comzvine.cozhttps://vine.co/v/{}zno video in the articleT)expected)	_match_idZ_download_jsongetr   r   r   formatr   )	selfr   Z
article_idZarticle_datar   Zprimary_photoinfor   Z
video_type r&   C/tmp/pip-unpacked-wheel-q5ljy6pj/yt_dlp/extractor/bleacherreport.py_real_extract,   s>    



zBleacherReportIE._real_extractN__name__
__module____qualname__Z_WORKINGZ
_VALID_URLZ_TESTSr(   r&   r&   r&   r'   r	      s<   

r	   c                	   @   s<   e Zd ZdZdZddddddd	d
ddgdgZdd ZdS )BleacherReportCMSIEFzRhttps?://(?:www\.)?bleacherreport\.com/video_embed\?id=(?P<id>[0-9a-f-]{36}|\d{5})z_http://bleacherreport.com/video_embed?id=8fd44c2f-3dc5-4821-9118-2c825a98c0e1&library=video-cmsZ 670b2d73f48549da032861130488c681z$8fd44c2f-3dc5-4821-9118-2c825a98c0e1r
   z6Cena vs. Rollins Would Expose the Heavyweight Divisionz$md5:984afb4ade2f9c0db35f3267ed88b36eZ20150723i=U)r   r   r   r   r   r   zUnable to download f4m manifest)r   r   r   Zexpected_warningsc                 C   s(   |  |}| d| d}||d< |S )Nz%http://vid.bleacherreport.com/videos/z.akamair   )r!   Z_extract_feed_info)r$   r   Zvideo_idr%   r&   r&   r'   r(   j   s    
z!BleacherReportCMSIE._real_extractNr)   r&   r&   r&   r'   r-   V   s   
r-   N)ampr   commonr   utilsr   r   r   r   r	   r-   r&   r&   r&   r'   <module>   s   K