From: cryptonaut Date: Sat, 6 Dec 2014 20:47:29 +0000 (-0800) Subject: Handle --get-url with merged formats (fixes #2883) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=16ae61f65515229b5cb4f5a60936bed3fa1b2b23;p=youtube-dl Handle --get-url with merged formats (fixes #2883) Outputs one URL per line --- diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 56dc3d461..248367039 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -942,8 +942,12 @@ class YoutubeDL(object): if self.params.get('forceid', False): self.to_stdout(info_dict['id']) if self.params.get('forceurl', False): - # For RTMP URLs, also include the playpath - self.to_stdout(info_dict['url'] + info_dict.get('play_path', '')) + if info_dict.get('requested_formats') is not None: + for f in info_dict['requested_formats']: + self.to_stdout(f['url'] + f.get('play_path', '')) + else: + # For RTMP URLs, also include the playpath + self.to_stdout(info_dict['url'] + info_dict.get('play_path', '')) if self.params.get('forcethumbnail', False) and info_dict.get('thumbnail') is not None: self.to_stdout(info_dict['thumbnail']) if self.params.get('forcedescription', False) and info_dict.get('description') is not None: