mirror of
https://github.com/alexta69/metube.git
synced 2025-04-04 12:47:38 +03:00
always set mp3 quality (closes #93)
This commit is contained in:
parent
dadc18951a
commit
e2ebb8c076
1 changed files with 5 additions and 7 deletions
|
@ -57,13 +57,11 @@ def get_opts(format: str, quality: str, ytdl_opts: dict) -> dict:
|
|||
opts["postprocessors"] = []
|
||||
|
||||
if format == "mp3":
|
||||
extra_args = {}
|
||||
if quality != "best":
|
||||
extra_args = {"preferredquality": quality}
|
||||
|
||||
opts["postprocessors"].append(
|
||||
{"key": "FFmpegExtractAudio", "preferredcodec": "mp3", **extra_args},
|
||||
)
|
||||
opts["postprocessors"].append({
|
||||
"key": "FFmpegExtractAudio",
|
||||
"preferredcodec": "mp3",
|
||||
"preferredquality": 0 if quality == "best" else quality},
|
||||
})
|
||||
opts["writethumbnail"] = True
|
||||
opts["postprocessors"].append({"key": "FFmpegMetadata"})
|
||||
opts["postprocessors"].append({"key": "EmbedThumbnail"})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue