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': 'af5f90dc9c7ba1c19d0a3eac806bbf50',
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:e95afafa43619816552723878b3b0a84',
39 'uploader_id': 6466954,
40 'upload_date': '20151011',
42 'add_ie': ['Youtube'],
44 'url': 'http://bleacherreport.com/articles/2496438-fsu-stat-projections-is-jalen-ramsey-best-defensive-player-in-college-football',
45 'md5': 'a3ffc3dc73afdbc2010f02d98f990f20',
49 'title': 'FSU Stat Projections: Is Jalen Ramsey Best Defensive Player in College Football?',
50 'upload_date': '20150615',
51 'uploader': 'Team Stream Now ',
52 'timestamp': 1434380212,
53 'description': 'CFB, ACC, Florida State',
54 'uploader_id': 3992341,
59 def _real_extract(self, url):
60 article_id = self._match_id(url)
62 article_data = self._download_json('http://api.bleacherreport.com/api/v1/articles/%s' % article_id, article_id)['article']
65 primary_photo = article_data.get('primaryPhoto')
68 'url': primary_photo['url'],
69 'width': primary_photo.get('width'),
70 'height': primary_photo.get('height'),
74 '_type': 'url_transparent',
76 'title': article_data['title'],
77 'uploader': article_data.get('author', {}).get('name'),
78 'uploader_id': article_data.get('authorId'),
79 'timestamp': parse_iso8601(article_data.get('createdAt')),
80 'thumbnails': thumbnails,
81 'comment_count': int_or_none(article_data.get('commentsCount')),
82 'view_count': int_or_none(article_data.get('hitCount')),
85 video = article_data.get('video')
87 video_type = video['type']
88 if video_type == 'cms.bleacherreport.com':
89 info['url'] = 'http://bleacherreport.com/video_embed?id=%s' % video['id']
90 elif video_type == 'ooyala.com':
91 info['url'] = 'ooyala:%s' % video['id']
92 elif video_type == 'youtube.com':
93 info['url'] = video['id']
94 elif video_type == 'vine.co':
95 info['url'] = 'https://vine.co/v/%s' % video['id']
97 info['url'] = video_type + video['id']
100 raise ExtractorError('no video in the article', expected=True)
103 class BleacherReportCMSIE(AMPIE):
104 _VALID_URL = r'https?://(?:www\.)?bleacherreport\.com/video_embed\?id=(?P<id>[0-9a-f-]{36})'
106 'url': 'http://bleacherreport.com/video_embed?id=8fd44c2f-3dc5-4821-9118-2c825a98c0e1',
107 'md5': 'f0ca220af012d4df857b54f792c586bb',
109 'id': '8fd44c2f-3dc5-4821-9118-2c825a98c0e1',
111 'title': 'Cena vs. Rollins Would Expose the Heavyweight Division',
112 'description': 'md5:984afb4ade2f9c0db35f3267ed88b36e',
116 def _real_extract(self, url):
117 video_id = self._match_id(url)
119 info = self._extract_feed_info('http://cms.bleacherreport.com/media/items/%s/akamai.json' % video_id)
120 info['id'] = video_id