mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-06 20:42:52 +08:00
Merge pull request #5 from JefferyHcool/dev_jeff
fix(bilibili_downloader): 移除音频转码步骤并更改输出格式
This commit is contained in:
@@ -31,13 +31,6 @@ class BilibiliDownloader(Downloader, ABC):
|
|||||||
ydl_opts = {
|
ydl_opts = {
|
||||||
'format': 'bestaudio[ext=m4a]/bestaudio/best',
|
'format': 'bestaudio[ext=m4a]/bestaudio/best',
|
||||||
'outtmpl': output_path,
|
'outtmpl': output_path,
|
||||||
'postprocessors': [
|
|
||||||
{
|
|
||||||
'key': 'FFmpegExtractAudio',
|
|
||||||
'preferredcodec': 'mp3',
|
|
||||||
'preferredquality': '64',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'noplaylist': True,
|
'noplaylist': True,
|
||||||
'quiet': False,
|
'quiet': False,
|
||||||
}
|
}
|
||||||
@@ -48,7 +41,7 @@ class BilibiliDownloader(Downloader, ABC):
|
|||||||
title = info.get("title")
|
title = info.get("title")
|
||||||
duration = info.get("duration", 0)
|
duration = info.get("duration", 0)
|
||||||
cover_url = info.get("thumbnail")
|
cover_url = info.get("thumbnail")
|
||||||
audio_path = os.path.join(output_dir, f"{video_id}.mp3")
|
audio_path = os.path.join(output_dir, f"{video_id}.m4a")
|
||||||
|
|
||||||
return AudioDownloadResult(
|
return AudioDownloadResult(
|
||||||
file_path=audio_path,
|
file_path=audio_path,
|
||||||
|
|||||||
Reference in New Issue
Block a user