used black
This commit is contained in:
@@ -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",
|
||||
],
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user