chore(wasm-output): authors, comments, cspell dict

This commit is contained in:
lainio24 2025-10-04 11:11:22 +08:00
parent cf3d9fd956
commit 760942ce68
No known key found for this signature in database
GPG Key ID: B333508B1D79D277
3 changed files with 17 additions and 5 deletions

View File

@ -17,6 +17,7 @@
"afterbegin", "afterbegin",
"afterend", "afterend",
"akari", "akari",
"alac",
"BALH", "BALH",
"Bangumi", "Bangumi",
"bcache", "bcache",
@ -75,6 +76,7 @@
"minmax", "minmax",
"mixins", "mixins",
"Muuri", "Muuri",
"muxer",
"overscroll", "overscroll",
"pako", "pako",
"plusplus", "plusplus",

View File

@ -11,10 +11,16 @@ export const plugin: PluginMetadata = {
name: 'downloadVideo.outputs.wasm', name: 'downloadVideo.outputs.wasm',
displayName: `下载视频 - ${title}`, displayName: `下载视频 - ${title}`,
description: desc, description: desc,
author: { author: [
name: 'WakelessSloth56', {
link: 'https://github.com/WakelessSloth56', name: 'WakelessSloth56',
}, link: 'https://github.com/WakelessSloth56',
},
{
name: 'LainIO24',
link: 'https://github.com/LainIO24',
},
],
setup: ({ addData }) => { setup: ({ addData }) => {
addData('downloadVideo.outputs', (outputs: DownloadVideoOutput[]) => { addData('downloadVideo.outputs', (outputs: DownloadVideoOutput[]) => {
outputs.push({ outputs.push({

View File

@ -10,6 +10,7 @@ const mp4Format: Format = {
args.push('-i', 'cover', '-i', 'metadata') args.push('-i', 'cover', '-i', 'metadata')
args.push('-map', '0', '-map', '1', '-map', '2') args.push('-map', '0', '-map', '1', '-map', '2')
args.push('-map_metadata', '3', '-disposition:2', 'attached_pic') args.push('-map_metadata', '3', '-disposition:2', 'attached_pic')
// mdta atom 格式元数据和封面互相干扰,不启用 +use_metadata_tags
} else if (hasCover && !hasMetadata) { } else if (hasCover && !hasMetadata) {
args.push('-i', 'cover') args.push('-i', 'cover')
args.push('-map', '0', '-map', '1', '-map', '2') args.push('-map', '0', '-map', '1', '-map', '2')
@ -19,7 +20,7 @@ const mp4Format: Format = {
args.push('-map_metadata', '2', '-movflags', '+use_metadata_tags') args.push('-map_metadata', '2', '-movflags', '+use_metadata_tags')
} }
args.push('-codec:v', 'copy') args.push('-codec:v', 'copy')
args.push('-codec:a', isFlac ? 'alac' : 'copy') args.push('-codec:a', isFlac ? 'alac' : 'copy') // MP4不支持FLAC使用ALAC重新编码FLAC
args.push('-f', 'mp4') args.push('-f', 'mp4')
return args return args
}, },
@ -62,6 +63,9 @@ export async function mux(
metadata: Uint8Array, metadata: Uint8Array,
) { ) {
if (outputType === 'auto') { if (outputType === 'auto') {
// 自动选择格式:
// FLAC音轨 -> MKV
// 元数据+封面 -> MKV
outputType = isFlac ? 'matroska' : 'mp4' outputType = isFlac ? 'matroska' : 'mp4'
outputType = cover && metadata ? 'matroska' : outputType outputType = cover && metadata ? 'matroska' : outputType
} }