Skip to content

Commit a966614

Browse files
committed
feat(downloaders): 更新 Bilibili 和 YouTube 下载器格式选择- 将 Bilibili 和 YouTube 下载器的格式选择从视频格式更改为音频格式
-优先选择 m4a 格式的最佳音频,如果没有可用的 m4a 格式,则选择最佳音频格式 - 如果没有可用的音频格式,则选择最佳格式
1 parent c6e0806 commit a966614

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

backend/app/downloaders/bilibili_downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def download_video(
6969
output_path = os.path.join(output_dir, "%(id)s.%(ext)s")
7070

7171
ydl_opts = {
72-
'format': 'best[height<=480][ext=mp4]/best[height<=480]/best',
72+
'format': 'bestaudio[ext=m4a]/bestaudio/best',
7373
'outtmpl': output_path,
7474
'noplaylist': True,
7575
'quiet': False,

backend/app/downloaders/youtube_downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def download(
3030
output_path = os.path.join(output_dir, "%(id)s.%(ext)s")
3131

3232
ydl_opts = {
33-
'format': 'best[height<=480][ext=mp4]/best[height<=480]/best',
33+
'format': 'bestaudio[ext=m4a]/bestaudio/best',
3434
'outtmpl': output_path,
3535
'noplaylist': True,
3636
'quiet': False,

0 commit comments

Comments
 (0)