diff --git a/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js b/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js index 99de408702d41..68230be2fe75c 100644 --- a/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js +++ b/src/renderer/components/ft-shaka-video-player/ft-shaka-video-player.js @@ -65,7 +65,7 @@ export default defineComponent({ }, manifestSrc: { type: String, - required: true + default: null }, manifestMimeType: { type: String, diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index 3e6aa93ca863f..6f152ebfa1ef9 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -272,7 +272,12 @@ export async function getLocalVideoInfo(id) { if (info.streaming_data) { decipherFormats(info.streaming_data.formats, webInnertube.session.player) - decipherFormats(info.streaming_data.adaptive_formats, webInnertube.session.player) + + const firstFormat = info.streaming_data.adaptive_formats[0] + + if (firstFormat.url || firstFormat.signature_cipher || firstFormat.cipher) { + decipherFormats(info.streaming_data.adaptive_formats, webInnertube.session.player) + } if (info.streaming_data.dash_manifest_url) { let url = info.streaming_data.dash_manifest_url diff --git a/src/renderer/views/Watch/Watch.js b/src/renderer/views/Watch/Watch.js index 8766736cf0ef6..719c96689aecf 100644 --- a/src/renderer/views/Watch/Watch.js +++ b/src/renderer/views/Watch/Watch.js @@ -695,25 +695,29 @@ export default defineComponent({ /** @type {import('../../helpers/api/local').LocalFormat[]} */ const formats = [...result.streaming_data.formats, ...result.streaming_data.adaptive_formats] - const downloadLinks = formats.map((format) => { - const qualityLabel = format.quality_label ?? format.bitrate - const fps = format.fps ? `${format.fps}fps` : 'kbps' - const type = format.mime_type.split(';')[0] - let label = `${qualityLabel} ${fps} - ${type}` - - if (format.has_audio !== format.has_video) { - if (format.has_video) { - label += ` ${this.$t('Video.video only')}` - } else { - label += ` ${this.$t('Video.audio only')}` + const downloadLinks = [] + + for (const format of formats) { + if (format.freeTubeUrl) { + const qualityLabel = format.quality_label ?? format.bitrate + const fps = format.fps ? `${format.fps}fps` : 'kbps' + const type = format.mime_type.split(';')[0] + let label = `${qualityLabel} ${fps} - ${type}` + + if (format.has_audio !== format.has_video) { + if (format.has_video) { + label += ` ${this.$t('Video.video only')}` + } else { + label += ` ${this.$t('Video.audio only')}` + } } - } - return { - url: format.freeTubeUrl, - label: label + downloadLinks.push({ + url: format.freeTubeUrl, + label: label + }) } - }) + } if (result.captions) { const captionTracks = result.captions?.caption_tracks?.map((caption) => { @@ -779,7 +783,7 @@ export default defineComponent({ return } - if (result.streaming_data?.adaptive_formats.length > 0) { + if (result.streaming_data?.adaptive_formats.length > 0 && result.streaming_data.adaptive_formats[0].freeTubeUrl) { this.vrProjection = result.streaming_data.adaptive_formats .find(format => { return format.has_video &&