1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

[nba] skip Legacy Video Files

This commit is contained in:
remitamine 2015-10-07 06:53:19 +01:00
parent c233e6bcc3
commit 139f27827e

View file

@ -38,11 +38,6 @@ class NBAIE(InfoExtractor):
} }
}] }]
_BASE_PATHS = {
'turner': 'http://nba.cdn.turner.com/nba/big',
'akamai': 'http://nbavod-f.akamaihd.net',
}
_QUALITIES = { _QUALITIES = {
'420mp4': { '420mp4': {
'width': 400, 'width': 400,
@ -54,55 +49,50 @@ class NBAIE(InfoExtractor):
'height': 234, 'height': 234,
'preference': 2, 'preference': 2,
}, },
'556': {
'width': 416,
'height': 234,
'preference': 3,
},
'480x320_910': { '480x320_910': {
'width': 480, 'width': 480,
'height': 320, 'height': 320,
'preference': 4, 'preference': 3,
}, },
'nba_576x324': { 'nba_576x324': {
'width': 576, 'width': 576,
'height': 324, 'height': 324,
'preference': 5, 'preference': 4,
}, },
'nba_640x360': { 'nba_640x360': {
'width': 640, 'width': 640,
'height': 360, 'height': 360,
'preference': 6, 'preference': 5,
}, },
'640x360_664b': { '640x360_664b': {
'width': 640, 'width': 640,
'height': 360, 'height': 360,
'preference': 7, 'preference': 6,
}, },
'640x360_664m': { '640x360_664m': {
'width': 640, 'width': 640,
'height': 360, 'height': 360,
'preference': 8, 'preference': 7,
}, },
'768x432_996': { '768x432_996': {
'width': 768, 'width': 768,
'height': 432, 'height': 432,
'preference': 9, 'preference': 8,
}, },
'768x432_1404': { '768x432_1404': {
'width': 768, 'width': 768,
'height': 432, 'height': 432,
'preference': 10, 'preference': 9,
}, },
'960x540_2104': { '960x540_2104': {
'width': 960, 'width': 960,
'height': 540, 'height': 540,
'preference': 11, 'preference': 10,
}, },
'1280x720_3072': { '1280x720_3072': {
'width': 1280, 'width': 1280,
'height': 720, 'height': 720,
'preference': 12, 'preference': 11,
}, },
} }
@ -127,11 +117,8 @@ class NBAIE(InfoExtractor):
formats = [] formats = []
for video_file in video_info.find('files').iter('file'): for video_file in video_info.find('files').iter('file'):
video_url = video_file.text video_url = video_file.text
if not video_url.startswith('http://'): if video_url.startswith('/'):
if video_url.endswith('.m3u8') or video_url.endswith('.f4m'): continue
video_url = self._BASE_PATHS['akamai'] + video_url
else:
video_url = self._BASE_PATHS['turner'] + video_url
if video_url.endswith('.m3u8'): if video_url.endswith('.m3u8'):
formats.extend(self._extract_m3u8_formats(video_url, video_id)) formats.extend(self._extract_m3u8_formats(video_url, video_id))
elif video_url.endswith('.f4m'): elif video_url.endswith('.f4m'):