o
    i                     @   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-football a3ffc3dc73afdbc2010f02d98f990f202496438mp4zPFSU Stat Projections: Is Jalen Ramsey Best Defensive Player in College Football?3992341zCFB, ACC, Florida Statei~U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-kangaroo 6a5cd403418c7b01719248ca97fb06922586817webmzMAussie Golfers Get Fright of Their Lives After Being Chased by Angry Kangarooi=VzSean Fayz$md5:b1601e2314c4d8eec23b6eafe086a757646695420151011)r   r   r   r   r   r   r   r   Youtube)r   r   r   add_iec           	      C   s,  |  |}| d| |d }g }|d}|r(|d |d|ddg}d||d	 |d
i dt|dt|d|t|dt|dd	}|d}|r|d }|dv rkd|d |d< |S |dkrw|d |d< |S |dkrd|d |d< |S ||d  |d< |S tddd)Nz.http://api.bleacherreport.com/api/v1/articles/articleprimaryPhotor   widthheight)r   r$   r%   url_transparentr   authornameauthorId	createdAtcommentsCounthitCount)	_typer   r   r   r   r   
thumbnailscomment_count
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_id_download_jsongetr   r   r   formatr   )	selfr   
article_idarticle_datar.   primary_photoinfor1   
video_type r>   S/home/ubuntu/.local/lib/python3.10/site-packages/yt_dlp/extractor/bleacherreport.py_real_extract,   sD   


zBleacherReportIE._real_extractN__name__
__module____qualname___WORKING
_VALID_URL_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-cms 670b2d73f48549da032861130488c681z$8fd44c2f-3dc5-4821-9118-2c825a98c0e1r   z6Cena vs. Rollins Would Expose the Heavyweight Divisionz$md5:984afb4ade2f9c0db35f3267ed88b36e20150723i=U)r   r   r   r   r   r   zUnable to download f4m manifest)r   r   r   expected_warningsc                 C   s(   |  |}| d| d}||d< |S )Nz%http://vid.bleacherreport.com/videos/z.akamair   )r4   _extract_feed_info)r8   r   video_idr<   r>   r>   r?   r@   j   s   
z!BleacherReportCMSIE._real_extractNrA   r>   r>   r>   r?   rH   V   s     
rH   N)ampr   commonr   utilsr   r   r   r   r	   rH   r>   r>   r>   r?   <module>   s
    K