Skip to content

Commit ea565b8

Browse files
author
思诺特
committed
fix(bilibili_downloader): 移除音频转码步骤并更改输出格式
- 移除了 ydl_opts 中的 postprocessors 设置,取消了将音频转码为 mp3 的步骤 - 将输出音频文件的扩展名从 mp3 改为 m4a
1 parent 4f19914 commit ea565b8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

backend/app/downloaders/bilibili_downloader.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ def download(
3131
ydl_opts = {
3232
'format': 'bestaudio[ext=m4a]/bestaudio/best',
3333
'outtmpl': output_path,
34-
'postprocessors': [
35-
{
36-
'key': 'FFmpegExtractAudio',
37-
'preferredcodec': 'mp3',
38-
'preferredquality': '64',
39-
}
40-
],
4134
'noplaylist': True,
4235
'quiet': False,
4336
}
@@ -48,7 +41,7 @@ def download(
4841
title = info.get("title")
4942
duration = info.get("duration", 0)
5043
cover_url = info.get("thumbnail")
51-
audio_path = os.path.join(output_dir, f"{video_id}.mp3")
44+
audio_path = os.path.join(output_dir, f"{video_id}.m4a")
5245

5346
return AudioDownloadResult(
5447
file_path=audio_path,

0 commit comments

Comments
 (0)