Use a dictionary for each of the parts in the parts field of the info_dict
Some multipart videos may requires rtmpdump, they would need additional fields.
This commit is contained in:
parent
23183a07b3
commit
776020147c
@ -778,7 +778,7 @@ class YoutubeDL(object):
|
||||
if not parts:
|
||||
success = self.fd._do_download(filename, info_dict)
|
||||
elif len(parts) == 1:
|
||||
info_dict['url'] = parts[0]
|
||||
info_dict.update(parts[0])
|
||||
success = self.fd._do_download(filename, info_dict)
|
||||
else:
|
||||
# We check if the final video has already been downloaded
|
||||
@ -789,9 +789,9 @@ class YoutubeDL(object):
|
||||
parts_success = []
|
||||
parts_files = []
|
||||
self.to_screen(u'[info] Downloading %s parts' % len(parts))
|
||||
for (i, part_url) in enumerate(parts):
|
||||
for (i, part) in enumerate(parts):
|
||||
part_info = dict(info_dict)
|
||||
part_info['url'] = part_url
|
||||
part_info.update(part)
|
||||
part_filename = u'%s.%s' % (filename, i)
|
||||
parts_files.append(part_filename)
|
||||
parts_success.append(self.fd._do_download(part_filename, part_info))
|
||||
|
@ -55,7 +55,9 @@ class InfoExtractor(object):
|
||||
subtitles: The subtitle file contents as a dictionary in the format
|
||||
{language: subtitles}.
|
||||
view_count: How many users have watched the video on the platform.
|
||||
parts: A list of urls for each of the parts of the video.
|
||||
parts: A list of info_dicts for each of the parts of the video,
|
||||
it must include the url field, if it's a rtmp download it
|
||||
can contain additional fields for rtmpdump.
|
||||
urlhandle: [internal] The urlHandle to be used to download the file,
|
||||
like returned by urllib.request.urlopen
|
||||
age_limit: Age restriction for the video, as an integer (years)
|
||||
|
@ -67,15 +67,11 @@ class TudouIE(InfoExtractor):
|
||||
part_id = part['k']
|
||||
final_url = self._url_for_id(part_id, quality)
|
||||
ext = (final_url.split('?')[0]).split('.')[-1]
|
||||
parts.append(final_url)
|
||||
parts.append({'url': final_url})
|
||||
|
||||
info_dict = {'id': video_id,
|
||||
return {'id': video_id,
|
||||
'ext': ext,
|
||||
'title': title,
|
||||
'thumbnail': thumbnail_url,
|
||||
'parts': parts,
|
||||
}
|
||||
if len_segs == 1:
|
||||
info_dict['url'] = parts[0]
|
||||
else:
|
||||
info_dict['parts'] = parts
|
||||
return info_dict
|
||||
|
Loading…
x
Reference in New Issue
Block a user