2 from .common
import InfoExtractor
11 class BleacherReportIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?bleacherreport\.com/articles/(?P<id>\d+)'
15 'url': 'http://bleacherreport.com/articles/2496438-fsu-stat-projections-is-jalen-ramsey-best-defensive-player-in-college-football',
16 'md5': 'a3ffc3dc73afdbc2010f02d98f990f20',
20 'title': 'FSU Stat Projections: Is Jalen Ramsey Best Defensive Player in College Football?',
21 'uploader_id': '3992341',
22 'description': 'CFB, ACC, Florida State',
23 'timestamp': 1434380212,
24 'upload_date': '20150615',
25 'uploader': 'Team Stream Now ',
27 'skip': 'Video removed',
29 'url': 'http://bleacherreport.com/articles/2586817-aussie-golfers-get-fright-of-their-lives-after-being-chased-by-angry-kangaroo',
30 'md5': '6a5cd403418c7b01719248ca97fb0692',
34 'title': 'Aussie Golfers Get Fright of Their Lives After Being Chased by Angry Kangaroo',
35 'timestamp': 1446839961,
36 'uploader': 'Sean Fay',
37 'description': 'md5:b1601e2314c4d8eec23b6eafe086a757',
38 'uploader_id': '6466954',
39 'upload_date': '20151011',
41 'add_ie': ['Youtube'],
44 def _real_extract(self
, url
):
45 article_id
= self
._match
_id
(url
)
47 article_data
= self
._download
_json
(f
'http://api.bleacherreport.com/api/v1/articles/{article_id}', article_id
)['article']
50 primary_photo
= article_data
.get('primaryPhoto')
53 'url': primary_photo
['url'],
54 'width': primary_photo
.get('width'),
55 'height': primary_photo
.get('height'),
59 '_type': 'url_transparent',
61 'title': article_data
['title'],
62 'uploader': article_data
.get('author', {}).get('name'),
63 'uploader_id': str_or_none(article_data
.get('authorId')),
64 'timestamp': parse_iso8601(article_data
.get('createdAt')),
65 'thumbnails': thumbnails
,
66 'comment_count': int_or_none(article_data
.get('commentsCount')),
67 'view_count': int_or_none(article_data
.get('hitCount')),
70 video
= article_data
.get('video')
72 video_type
= video
['type']
73 if video_type
in ('cms.bleacherreport.com', 'vid.bleacherreport.com'):
74 info
['url'] = 'http://bleacherreport.com/video_embed?id={}'.format(video
['id'])
75 elif video_type
== 'youtube.com':
76 info
['url'] = video
['id']
77 elif video_type
== 'vine.co':
78 info
['url'] = 'https://vine.co/v/{}'.format(video
['id'])
80 info
['url'] = video_type
+ video
['id']
83 raise ExtractorError('no video in the article', expected
=True)
86 class BleacherReportCMSIE(AMPIE
):
88 _VALID_URL
= r
'https?://(?:www\.)?bleacherreport\.com/video_embed\?id=(?P<id>[0-9a-f-]{36}|\d{5})'
90 'url': 'http://bleacherreport.com/video_embed?id=8fd44c2f-3dc5-4821-9118-2c825a98c0e1&library=video-cms',
91 'md5': '670b2d73f48549da032861130488c681',
93 'id': '8fd44c2f-3dc5-4821-9118-2c825a98c0e1',
95 'title': 'Cena vs. Rollins Would Expose the Heavyweight Division',
96 'description': 'md5:984afb4ade2f9c0db35f3267ed88b36e',
97 'upload_date': '20150723',
98 'timestamp': 1437679032,
101 'expected_warnings': [
102 'Unable to download f4m manifest',
106 def _real_extract(self
, url
):
107 video_id
= self
._match
_id
(url
)
108 info
= self
._extract
_feed
_info
(f
'http://vid.bleacherreport.com/videos/{video_id}.akamai')
109 info
['id'] = video_id