[vimeo] Add fallback mp4 extension for original format
authorSergey M․ <dstftw@gmail.com>
Mon, 19 Jun 2017 18:27:59 +0000 (01:27 +0700)
committerSergey M․ <dstftw@gmail.com>
Mon, 19 Jun 2017 18:27:59 +0000 (01:27 +0700)
youtube_dl/extractor/vimeo.py

index a483c8409ccc8ff469739f1a64e9dbb20c914039..c3f71b45e3bbee17bbf7e1d4787ac0aa888f251b 100644 (file)
@@ -615,7 +615,10 @@ class VimeoIE(VimeoBaseInfoExtractor):
                 if download_url and not source_file.get('is_cold') and not source_file.get('is_defrosting'):
                     source_name = source_file.get('public_name', 'Original')
                     if self._is_valid_url(download_url, video_id, '%s video' % source_name):
-                        ext = source_file.get('extension', determine_ext(download_url)).lower()
+                        ext = (try_get(
+                            source_file, lambda x: x['extension'],
+                            compat_str) or determine_ext(
+                            download_url, None) or 'mp4').lower()
                         formats.append({
                             'url': download_url,
                             'ext': ext,