]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/espn.py
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>[^/]+)'
10 'url': 'http://espn.go.com/video/clip?id=10365079',
12 'id': 'FkYWtmazr6Ed8xmvILvKLWjd4QvYZpzG',
14 'title': 'dm_140128_30for30Shorts___JudgingJewellv2',
19 'skip_download': True,
22 'url': 'https://espn.go.com/video/iframe/twitter/?cms=espn&id=10365079',
23 'only_matching': True,
25 'url': 'http://espn.go.com/nba/recap?gameId=400793786',
26 'only_matching': True,
28 'url': 'http://espn.go.com/blog/golden-state-warriors/post/_/id/593/how-warriors-rapidly-regained-a-winning-edge',
29 'only_matching': True,
31 'url': 'http://espn.go.com/sports/endurance/story/_/id/12893522/dzhokhar-tsarnaev-sentenced-role-boston-marathon-bombings',
32 'only_matching': True,
34 'url': 'http://espn.go.com/nba/playoffs/2015/story/_/id/12887571/john-wall-washington-wizards-no-swelling-left-hand-wrist-game-5-return',
35 'only_matching': True,
38 def _real_extract(self
, url
):
39 video_id
= self
._match
_id
(url
)
41 webpage
= self
._download
_webpage
(url
, video_id
)
43 video_id
= self
._search
_regex
(
44 r
'class="video-play-button"[^>]+data-id="(\d+)',
47 player
= self
._download
_webpage
(
48 'https://espn.go.com/video/iframe/twitter/?id=%s' % video_id
, video_id
)
50 pcode
= self
._search
_regex
(
51 r
'["\']pcode
=([^
"\']+)["\']', player, 'pcode
')
53 return self.url_result(
54 'ooyalaexternal
:espn
:%s:%s' % (video_id, pcode),