use 0x0.st instead of pastebin
This commit is contained in:
parent
e1da1b82ab
commit
94b07ac7f3
1 changed files with 6 additions and 13 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue