1 from __future__ import unicode_literals
3 from .common import InfoExtractor
6 class ESPNIE(InfoExtractor):
7 _VALID_URL = r'https?://espn\.go\.com/(?:[^/]+/)*(?P<id>[^/]+)'
9 'url': 'http://espn.go.com/video/clip?id=10365079',
11 'id': 'FkYWtmazr6Ed8xmvILvKLWjd4QvYZpzG',
13 'title': 'dm_140128_30for30Shorts___JudgingJewellv2',
18 'skip_download': True,
21 'url': 'https://espn.go.com/video/iframe/twitter/?cms=espn&id=10365079',
22 'only_matching': True,
24 'url': 'http://espn.go.com/nba/recap?gameId=400793786',
25 'only_matching': True,
27 'url': 'http://espn.go.com/blog/golden-state-warriors/post/_/id/593/how-warriors-rapidly-regained-a-winning-edge',
28 'only_matching': True,
30 'url': 'http://espn.go.com/sports/endurance/story/_/id/12893522/dzhokhar-tsarnaev-sentenced-role-boston-marathon-bombings',
31 'only_matching': True,
33 'url': 'http://espn.go.com/nba/playoffs/2015/story/_/id/12887571/john-wall-washington-wizards-no-swelling-left-hand-wrist-game-5-return',
34 'only_matching': True,
37 def _real_extract(self, url):
38 video_id = self._match_id(url)
40 webpage = self._download_webpage(url, video_id)
42 video_id = self._search_regex(
43 r'class="video-play-button"[^>]+data-id="(\d+)',
46 player = self._download_webpage(
47 'https://espn.go.com/video/iframe/twitter/?id=%s' % video_id, video_id)
49 pcode = self._search_regex(
50 r'["\']pcode=([^"\']+)["\']', player, 'pcode')
52 return self.url_result(
53 'ooyalaexternal:espn:%s:%s' % (video_id, pcode),