mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
youku default to download hd2 video
This commit is contained in:
parent
302efc19ea
commit
0a98b09bc2
2 changed files with 20 additions and 4 deletions
BIN
youtube-dl
BIN
youtube-dl
Binary file not shown.
|
@ -3035,11 +3035,27 @@ def _real_extract(self, url):
|
||||||
|
|
||||||
video_title = config['data'][0]['title']
|
video_title = config['data'][0]['title']
|
||||||
seed = config['data'][0]['seed']
|
seed = config['data'][0]['seed']
|
||||||
#choose format flv first
|
|
||||||
format = 'flv'
|
format = self._downloader.params.get('format', None)
|
||||||
|
supported_format = config['data'][0]['streamfileids'].keys()
|
||||||
|
|
||||||
|
if format is None or format == 'best':
|
||||||
|
if 'hd2' in supported_format:
|
||||||
|
format = 'hd2'
|
||||||
|
else:
|
||||||
|
format = 'flv'
|
||||||
|
ext = u'flv'
|
||||||
|
elif format == 'worst':
|
||||||
|
format = 'mp4'
|
||||||
|
ext = u'mp4'
|
||||||
|
else:
|
||||||
|
format = 'flv'
|
||||||
|
ext = u'flv'
|
||||||
|
|
||||||
|
|
||||||
fileid = config['data'][0]['streamfileids'][format]
|
fileid = config['data'][0]['streamfileids'][format]
|
||||||
seg_number = len(config['data'][0]['segs'][format])
|
seg_number = len(config['data'][0]['segs'][format])
|
||||||
|
|
||||||
keys=[]
|
keys=[]
|
||||||
for i in xrange(seg_number):
|
for i in xrange(seg_number):
|
||||||
keys.append(config['data'][0]['segs'][format][i]['k'])
|
keys.append(config['data'][0]['segs'][format][i]['k'])
|
||||||
|
@ -3065,8 +3081,8 @@ def _real_extract(self, url):
|
||||||
'id': '%s_part%02x' % (video_id, index),
|
'id': '%s_part%02x' % (video_id, index),
|
||||||
'url': download_url,
|
'url': download_url,
|
||||||
'uploader': None,
|
'uploader': None,
|
||||||
'title': '%s_part%02x' % (video_title, index),
|
'title': video_title
|
||||||
'ext': u'flv',
|
'ext': ext,
|
||||||
'format': u'NA'
|
'format': u'NA'
|
||||||
}
|
}
|
||||||
files_info.append(info)
|
files_info.append(info)
|
||||||
|
|
Loading…
Reference in a new issue