Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
Fix ytdlp audio formats

Signed-off-by: Dawn India <[email protected]>
  • Loading branch information
Dawn-India committed Aug 17, 2024
1 parent 430ee93 commit cb8dcfc
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions bot/helper/listeners/ytdlp_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,10 @@ async def get_quality(self, result):
tbr_dict
) in self.formats.items():
if len(tbr_dict) == 1:
tbr, v_list = next(iter(tbr_dict.items()))
(
tbr,
v_list
) = next(iter(tbr_dict.items()))
buttonName = f"{b_name} ({get_readable_file_size(v_list[0])})"
buttons.ibutton(
buttonName,
Expand Down Expand Up @@ -289,7 +292,10 @@ async def back_to_main(self):
async def qual_subbuttons(self, b_name):
buttons = ButtonMaker()
tbr_dict = self.formats[b_name]
for tbr, d_data in tbr_dict.items():
for (
tbr,
d_data
) in tbr_dict.items():
button_name = f"{tbr}K ({get_readable_file_size(d_data[0])})"
buttons.ibutton(
button_name,
Expand Down Expand Up @@ -350,13 +356,13 @@ async def audio_format(self):
i = "s" if self._is_playlist else ""
buttons = ButtonMaker()
for frmt in [
"ᴀᴀᴄ",
"ᴀʟᴀᴄ",
"ꜰʟᴀᴄ",
"ᴍ4ᴀ",
"ᴏᴘᴜꜱ",
"ᴠᴏʀʙɪꜱ",
"ᴡᴀᴠ"
"aac",
"alac",
"flac",
"m4a",
"opus",
"vorbis",
"wav"
]:
audio_format = f"ba/b-{frmt}-"
buttons.ibutton(
Expand Down

0 comments on commit cb8dcfc

Please sign in to comment.