This commit is contained in:
parent
9e164ff0f5
commit
346945c638
9
bot.py
9
bot.py
@ -53,11 +53,12 @@ class CustomClient(discord.Client):
|
|||||||
timeout=aiohttp.ClientTimeout(total=5)
|
timeout=aiohttp.ClientTimeout(total=5)
|
||||||
) as session:
|
) as session:
|
||||||
resp = await session.head(
|
resp = await session.head(
|
||||||
"https://stream.purser.it/{stripped}/?provider=seafile&raw=true"
|
"https://stream.purser.it/{stripped}/?provider=seafile&raw=true",
|
||||||
|
allow_redirects=True,
|
||||||
)
|
)
|
||||||
raw = (
|
raw = str(
|
||||||
ctype := resp.headers.get("content-type")
|
(ctype := resp.headers.get("content-type")) and "image" in ctype
|
||||||
) and "image" in ctype
|
).lower()
|
||||||
|
|
||||||
await message.reply(
|
await message.reply(
|
||||||
content=f"https://stream.purser.it/{stripped}/?provider=seafile&raw={raw}"
|
content=f"https://stream.purser.it/{stripped}/?provider=seafile&raw={raw}"
|
||||||
|
Loading…
Reference in New Issue
Block a user