]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/bleacherreport.py
e829974ff1e5aa6e0b79c0567e2febe0fc683028
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
13 class BleacherReportIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?bleacherreport\.com/articles/(?P<id>\d+)'
16 'url': 'http://bleacherreport.com/articles/2496438-fsu-stat-projections-is-jalen-ramsey-best-defensive-player-in-college-football',
17 'md5': 'a3ffc3dc73afdbc2010f02d98f990f20',
21 'title': 'FSU Stat Projections: Is Jalen Ramsey Best Defensive Player in College Football?',
22 'uploader_id': 3992341,
23 'description': 'CFB, ACC, Florida State',
24 'timestamp': 1434380212,
25 'upload_date': '20150615',
26 'uploader': 'Team Stream Now ',
30 'url': 'http://bleacherreport.com/articles/2586817-aussie-golfers-get-fright-of-their-lives-after-being-chased-by-angry-kangaroo',
31 'md5': '6a5cd403418c7b01719248ca97fb0692',
35 'title': 'Aussie Golfers Get Fright of Their Lives After Being Chased by Angry Kangaroo',
36 'timestamp': 1446839961,
37 'uploader': 'Sean Fay',
38 'description': 'md5:b1601e2314c4d8eec23b6eafe086a757',
39 'uploader_id': 6466954,
40 'upload_date': '20151011',
42 'add_ie': ['Youtube'],
45 def _real_extract(self
, url
):
46 article_id
= self
._match
_id
(url
)
48 article_data
= self
._download
_json
('http://api.bleacherreport.com/api/v1/articles/%s' % article_id
, article_id
)['article']
51 primary_photo
= article_data
.get('primaryPhoto')
54 'url': primary_photo
['url'],
55 'width': primary_photo
.get('width'),
56 'height': primary_photo
.get('height'),
60 '_type': 'url_transparent',
62 'title': article_data
['title'],
63 'uploader': article_data
.get('author', {}).get('name'),
64 'uploader_id': article_data
.get('authorId'),
65 'timestamp': parse_iso8601(article_data
.get('createdAt')),
66 'thumbnails': thumbnails
,
67 'comment_count': int_or_none(article_data
.get('commentsCount')),
68 'view_count': int_or_none(article_data
.get('hitCount')),
71 video
= article_data
.get('video')
73 video_type
= video
['type']
74 if video_type
== 'cms.bleacherreport.com':
75 info
['url'] = 'http://bleacherreport.com/video_embed?id=%s' % video
['id']
76 elif video_type
== 'ooyala.com':
77 info
['url'] = 'ooyala:%s' % video
['id']
78 elif video_type
== 'youtube.com':
79 info
['url'] = video
['id']
80 elif video_type
== 'vine.co':
81 info
['url'] = 'https://vine.co/v/%s' % video
['id']
83 info
['url'] = video_type
+ video
['id']
86 raise ExtractorError('no video in the article', expected
=True)
89 class BleacherReportCMSIE(AMPIE
):
90 _VALID_URL
= r
'https?://(?:www\.)?bleacherreport\.com/video_embed\?id=(?P<id>[0-9a-f-]{36})'
92 'url': 'http://bleacherreport.com/video_embed?id=8fd44c2f-3dc5-4821-9118-2c825a98c0e1',
93 'md5': '2e4b0a997f9228ffa31fada5c53d1ed1',
95 'id': '8fd44c2f-3dc5-4821-9118-2c825a98c0e1',
97 'title': 'Cena vs. Rollins Would Expose the Heavyweight Division',
98 'description': 'md5:984afb4ade2f9c0db35f3267ed88b36e',
102 def _real_extract(self
, url
):
103 video_id
= self
._match
_id
(url
)
104 info
= self
._extract
_feed
_info
('http://cms.bleacherreport.com/media/items/%s/akamai.json' % video_id
)
105 info
['id'] = video_id