Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default defineComponent({
},
manifestSrc: {
type: String,
required: true
default: null
},
manifestMimeType: {
type: String,
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/helpers/api/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 21 additions & 17 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 &&
Expand Down