Use 0x0.st instead of my paste bin

This commit is contained in:
Nexus 2024-04-16 00:31:53 +01:00
parent c90fc5e7fa
commit 1d04aa6e18
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -539,25 +539,16 @@ class OtherCog(commands.Cog):
try: try:
file.seek(0) file.seek(0)
response = await self.http.post( response = await self.http.post(
"https://paste.nexy7574.co.uk/upload", "https://0x0.st",
data={
"expiration": "1week",
"burn_after": "0",
"syntax_highlight": "none",
"privacy": "unlisted",
"content": text
},
files={ files={
"file": (attachment.filename, file, attachment.content_type) "file": ("ocr.txt", io.StringIO(text), "text/plain")
}, },
follow_redirects=False
) )
if response.status_code not in range(200, 400):
response.raise_for_status() response.raise_for_status()
except httpx.HTTPError as e: except httpx.HTTPError as e:
raise RuntimeError(f"Failed to upload OCR content: `{e}`") raise RuntimeError(f"Failed to upload OCR content: `{e}`")
else: else:
text = "View on [paste.nexy7574.co.uk](%s)" % response.next_request.url text = "View on [0x0.st](%s)" % response.text.strip()
timings["Upload text to pastebin"] = _t.total timings["Upload text to pastebin"] = _t.total
return timings, text return timings, text