used black

This commit is contained in:
hhh
2024-11-02 00:10:24 +02:00
parent 1b1f217b75
commit e0a3d256d5
79 changed files with 658 additions and 733 deletions

View File

@@ -9,24 +9,21 @@ class MusicUrlFilter(BaseFilter):
pass
async def __call__(self, inline_query: InlineQuery):
if not inline_query.query.strip().startswith('http'):
if not inline_query.query.strip().startswith("http"):
return False
url = urlparse(inline_query.query)
return (
url.scheme in ['http', 'https'] and
any(
map(
url.netloc.endswith,
[
'youtube.com',
'youtu.be',
'open.spotify.com',
'spotify.link',
'deezer.page.link',
'deezer.com',
'soundcloud.com'
]
)
)
return url.scheme in ["http", "https"] and any(
map(
url.netloc.endswith,
[
"youtube.com",
"youtu.be",
"open.spotify.com",
"spotify.link",
"deezer.page.link",
"deezer.com",
"soundcloud.com",
],
)
)