X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fespn.py;h=db4b263bcbf40a9cb133d2a9729e4fe07292bae3;hb=0fc871d2f0ae57b88f78c32e3f76bfc1ca609ef0;hp=0a917f9f636973de3a1538372c8b24055d14a851;hpb=930087f2f69d887d768f234c5dc4563c5ad86ad6;p=youtube-dl diff --git a/youtube_dl/extractor/espn.py b/youtube_dl/extractor/espn.py index 0a917f9f6..db4b263bc 100644 --- a/youtube_dl/extractor/espn.py +++ b/youtube_dl/extractor/espn.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals from .common import InfoExtractor +from ..utils import remove_end class ESPNIE(InfoExtractor): @@ -10,7 +11,7 @@ class ESPNIE(InfoExtractor): 'info_dict': { 'id': 'FkYWtmazr6Ed8xmvILvKLWjd4QvYZpzG', 'ext': 'mp4', - 'title': 'dm_140128_30for30Shorts___JudgingJewellv2', + 'title': '30 for 30 Shorts: Judging Jewell', 'description': None, }, 'params': { @@ -23,7 +24,7 @@ class ESPNIE(InfoExtractor): 'info_dict': { 'id': '50NDFkeTqRHB0nXBOK-RGdSG5YQPuxHg', 'ext': 'mp4', - 'title': 'int_151206_Must_See_Moments_Best_of_MLS_2015_season', + 'title': 'Must-See Moments: Best of the MLS season', }, 'params': { # m3u8 download @@ -52,8 +53,8 @@ class ESPNIE(InfoExtractor): webpage = self._download_webpage(url, video_id) video_id = self._search_regex( - r'class="video-play-button"[^>]+data-id="(\d+)', - webpage, 'video id') + r'class=(["\']).*?video-play-button.*?\1[^>]+data-id=["\'](?P\d+)', + webpage, 'video id', group='id') cms = 'espn' if 'data-source="intl"' in webpage: @@ -65,6 +66,13 @@ class ESPNIE(InfoExtractor): pcode = self._search_regex( r'["\']pcode=([^"\']+)["\']', player, 'pcode') - return self.url_result( - 'ooyalaexternal:%s:%s:%s' % (cms, video_id, pcode), - 'OoyalaExternal') + title = remove_end( + self._og_search_title(webpage), + '- ESPN Video').strip() + + return { + '_type': 'url_transparent', + 'url': 'ooyalaexternal:%s:%s:%s' % (cms, video_id, pcode), + 'ie_key': 'OoyalaExternal', + 'title': title, + }