
    yf                     `    d dl mZ d dlmZ ddlmZmZmZmZ  G d de      Z	 G d de      Z
y	)
   )InfoExtractor)AMPIE   )ExtractorErrorint_or_noneparse_iso8601str_or_nonec                   \    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 Zy)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                    | j                  |      }| j                  d|z  |      d   }g }|j                  d      }|r(|d   |j                  d      |j                  d      dg}d||d	   |j                  d
i       j                  d      t        |j                  d            t	        |j                  d            |t        |j                  d            t        |j                  d            d	}|j                  d      }|rD|d   }|dv rd|d   z  |d<   |S |dk(  r
|d   |d<   |S |dk(  rd|d   z  |d<   |S ||d   z   |d<   |S t        dd      )Nz0http://api.bleacherreport.com/api/v1/articles/%s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=%sr   zyoutube.comzvine.cozhttps://vine.co/v/%szno video in the articleT)expected)	_match_id_download_jsongetr	   r   r   r   )	selfr   
article_idarticle_datar1   primary_photoinfor4   
video_types	            A/usr/lib/python3/dist-packages/yt_dlp/extractor/bleacherreport.py_real_extractzBleacherReportIE._real_extract,   s   ^^C(
**+]`j+jlvw  yB  C
$((8$U+&**73'++H5 J '!'*$((26::6B&|'7'7
'CD&|'7'7'DE$()9)9/)JK%l&6&6z&BC

   )vJQQKeTXkYU K },#DkU
 K	 y(4uT{BU K )5;6UK !:TJJ    N__name__
__module____qualname___WORKING
_VALID_URL_TESTSrA    rB   r@   r   r      s{    HOJ K1g$4#%*	
   J1d#"A$%	
 +F<'KrB   r   c            	       :    e Zd ZdZdZddddddd	d
ddgdgZd Zy)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                 Z    | j                  |      }| j                  d|z        }||d<   |S )Nz.http://vid.bleacherreport.com/videos/%s.akamair   )r7   _extract_feed_info)r:   r   video_idr>   s       r@   rA   z!BleacherReportCMSIE._real_extractj   s5    >>#&&&'WZb'bcT
rB   NrC   rJ   rB   r@   rL   rL   V   sD    HfJp18MA%#
 .
 F"rB   rL   N)commonr   ampr   utilsr   r   r   r	   r   rL   rJ   rB   r@   <module>rV      s2    !  HK} HKV% rB   