Fix youtube downloading wrong track, saving exceptions, attempt to fix deezer

This commit is contained in:
BarsTiger
2023-10-30 23:39:54 +02:00
parent 2ae18aacae
commit 8cd956388e
13 changed files with 272 additions and 39 deletions

View File

@@ -0,0 +1,32 @@
from aiogram.utils.keyboard import (InlineKeyboardMarkup, InlineKeyboardButton,
InlineKeyboardBuilder)
deezer = {
'd': '🎵 Search in Deezer'
}
soundcloud = {
'c': '☁️ Search in SoundCloud'
}
youtube = {
'y': '▶️ Search in YouTube'
}
spotify = {
's': '🎧 Search in Spotify'
}
def get_search_variants_kb(
query: str,
services: dict[str, str],
) -> InlineKeyboardMarkup:
buttons = [
[
InlineKeyboardButton(
text=services[key],
switch_inline_query_current_chat=f'{key}:{query}'
)
] for key in services.keys()
]
return InlineKeyboardBuilder(buttons).as_markup()