-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update WASM plugins logic #4686
Conversation
if (fragments.length === 2) { | ||
await run(fragments[0].title, toast, fragments[0].url, fragments[1].url) // [dash] | ||
} else { | ||
await run(fragments[0].title, toast, fragments[0].url) // [flv | m4a] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
只有单个流的话不用这个插件,没必要过一遍 FFmpeg,报个错就行,让用户直接下载。
if ( | ||
fragments.length > 2 || | ||
(fragments.length === 2 && | ||
!(fragments[0].extension === '.mp4' && fragments[1].extension === '.m4a')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extension
是可以自定义的(#4449),如果用户自定义了扩展名这里的条件就会出问题。
Direct link download flv/m4a in WASM
在我这里ffmpeg处理flac音频时会出现文件异常的情况,这个参数需要改吗 await ffmpeg.exec(['-i', 'video', '-i', 'audio', '-c:v', 'copy', '-c:a', 'copy', 'output.mp4']) |
因为输出是 MP4 容器,它是不支持 FLAC 流的,如果是 FLAC 音频的话用 Matroska 容器( |
@@ -47,3 +45,15 @@ export async function run(name: string, videoUrl: string, audioUrl: string, toas | |||
|
|||
await DownloadPackage.single(name, outputBlob) | |||
} | |||
|
|||
export async function downloadFromLink(name: string, toast: Toast, url: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个插件不需要下载单个文件,这里给出用户提示之后就不要做什么了,下载单个文件已经有 Toast
StreamSaver、aria2、IDM 等很多方式了。
Add use WASM to download video containing flac audio
fix: 解决旧版WASM下载两个音频或flv存在重复下载的问题,并限制仅支持单个视频下载