]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/bleacherreport.py
1 from .common
import InfoExtractor
10 class BleacherReportIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?bleacherreport\.com/articles/(?P<id>\d+)'
13 'url': 'http://bleacherreport.com/articles/2496438-fsu-stat-projections-is-jalen-ramsey-best-defensive-player-in-college-football',
14 'md5': 'a3ffc3dc73afdbc2010f02d98f990f20',
18 'title': 'FSU Stat Projections: Is Jalen Ramsey Best Defensive Player in College Football?',
19 'uploader_id': 3992341,
20 'description': 'CFB, ACC, Florida State',
21 'timestamp': 1434380212,
22 'upload_date': '20150615',
23 'uploader': 'Team Stream Now ',
27 'url': 'http://bleacherreport.com/articles/2586817-aussie-golfers-get-fright-of-their-lives-after-being-chased-by-angry-kangaroo',
28 'md5': '6a5cd403418c7b01719248ca97fb0692',
32 'title': 'Aussie Golfers Get Fright of Their Lives After Being Chased by Angry Kangaroo',
33 'timestamp': 1446839961,
34 'uploader': 'Sean Fay',
35 'description': 'md5:b1601e2314c4d8eec23b6eafe086a757',
36 'uploader_id': 6466954,
37 'upload_date': '20151011',
39 'add_ie': ['Youtube'],
42 def _real_extract(self
, url
):
43 article_id
= self
._match
_id
(url
)
45 article_data
= self
._download
_json
('http://api.bleacherreport.com/api/v1/articles/%s' % article_id
, article_id
)['article']
48 primary_photo
= article_data
.get('primaryPhoto')
51 'url': primary_photo
['url'],
52 'width': primary_photo
.get('width'),
53 'height': primary_photo
.get('height'),
57 '_type': 'url_transparent',
59 'title': article_data
['title'],
60 'uploader': article_data
.get('author', {}).get('name'),
61 'uploader_id': article_data
.get('authorId'),
62 'timestamp': parse_iso8601(article_data
.get('createdAt')),
63 'thumbnails': thumbnails
,
64 'comment_count': int_or_none(article_data
.get('commentsCount')),
65 'view_count': int_or_none(article_data
.get('hitCount')),
68 video
= article_data
.get('video')
70 video_type
= video
['type']
71 if video_type
in ('cms.bleacherreport.com', 'vid.bleacherreport.com'):
72 info
['url'] = 'http://bleacherreport.com/video_embed?id=%s' % video
['id']
73 elif video_type
== 'ooyala.com':
74 info
['url'] = 'ooyala:%s' % 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/%s' % video
['id']
80 info
['url'] = video_type
+ video
['id']
83 raise ExtractorError('no video in the article', expected
=True)
86 class BleacherReportCMSIE(AMPIE
):
87 _VALID_URL
= r
'https?://(?:www\.)?bleacherreport\.com/video_embed\?id=(?P<id>[0-9a-f-]{36}|\d{5})'
89 'url': 'http://bleacherreport.com/video_embed?id=8fd44c2f-3dc5-4821-9118-2c825a98c0e1&library=video-cms',
90 'md5': '670b2d73f48549da032861130488c681',
92 'id': '8fd44c2f-3dc5-4821-9118-2c825a98c0e1',
94 'title': 'Cena vs. Rollins Would Expose the Heavyweight Division',
95 'description': 'md5:984afb4ade2f9c0db35f3267ed88b36e',
96 'upload_date': '20150723',
97 'timestamp': 1437679032,
100 'expected_warnings': [
101 'Unable to download f4m manifest'
105 def _real_extract(self
, url
):
106 video_id
= self
._match
_id
(url
)
107 info
= self
._extract
_feed
_info
('http://vid.bleacherreport.com/videos/%s.akamai' % video_id
)
108 info
['id'] = video_id