- files['other'].append((codec_name, codec_extension, config_files[codec_name][0]))
-
- for quality in ('hd', 'sd', 'other'):
- if len(files[quality]) > 0:
- video_quality = files[quality][0][2]
- video_codec = files[quality][0][0]
- video_extension = files[quality][0][1]
- self.to_screen(u'%s: Downloading %s file at %s quality' % (video_id, video_codec.upper(), video_quality))
- break
- else:
+ file_info = {}
+ if video_url is None:
+ video_url = "http://player.vimeo.com/play_redirect?clip_id=%s&sig=%s&time=%s&quality=%s&codecs=%s&type=moogaloop_local&embed_location=" \
+ %(video_id, sig, timestamp, quality, codec_name.upper())
+
+ files[key].append({
+ 'ext': codec_extension,
+ 'url': video_url,
+ 'format_id': format_id,
+ 'width': file_info.get('width'),
+ 'height': file_info.get('height'),
+ })
+ formats = []
+ for key in ('other', 'sd', 'hd'):
+ formats += files[key]
+ if len(formats) == 0: