use 0x0.st instead of pastebin

This commit is contained in:
Nexus 2024-04-16 00:34:41 +01:00
parent e1da1b82ab
commit 94b07ac7f3
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -185,24 +185,17 @@ class AutoResponder(commands.Cog):
self.log.info("Trying to upload file to pastebin.") self.log.info("Trying to upload file to pastebin.")
async with httpx.AsyncClient() as client: async with httpx.AsyncClient() as client:
response = await client.post( response = await client.post(
"https://paste.nexy7574.co.uk/upload", "https://0x0.st",
data={
"expiration": "3days",
"burn_after": "0",
"syntax_highlight": "none",
"privacy": "unlisted",
"content": ""
},
files={ files={
"file": (_p.name, file.fp, "video/mp4") "file": (_p.name, file.fp, "video/mp4")
}, },
follow_redirects=False headers={
"User-Agent": "CollegeBot (matrix: @nex:nexy7574.co.uk)"
}
) )
if response.status_code == 302: if response.status_code == 200:
loc = response.headers["Location"]
loc = loc.replace("/upload/", "/file/", 1)
await message.reply( await message.reply(
"https://embeds.video/" + loc "https://embeds.video/" + response.text.strip()
) )
_p.unlink() _p.unlink()
except Exception as e: except Exception as e: