mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 10:03:40 +01:00
Use 0x0.st instead of my paste bin
This commit is contained in:
parent
c90fc5e7fa
commit
1d04aa6e18
1 changed files with 4 additions and 13 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue