mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 19:14:51 +00:00
Update paste.py
This commit is contained in:
parent
6403e6d406
commit
acfe74be3a
1 changed files with 2 additions and 0 deletions
|
|
@ -431,10 +431,12 @@ async def imgbb_upload(_, message):
|
||||||
uname = message.sender_chat.title
|
uname = message.sender_chat.title
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
path = await reply.download()
|
||||||
data = {"type": "file", "action": "upload"}
|
data = {"type": "file", "action": "upload"}
|
||||||
files = {"source": (path, open(path, "rb"), "images/jpeg")}
|
files = {"source": (path, open(path, "rb"), "images/jpeg")}
|
||||||
headers = {"origin": "https://imgbb.com", "referer": "https://imgbb.com/upload", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.42"}
|
headers = {"origin": "https://imgbb.com", "referer": "https://imgbb.com/upload", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.42"}
|
||||||
res = await fetch.post("https://imgbb.com/json", files=files, data=data, headers=headers)
|
res = await fetch.post("https://imgbb.com/json", files=files, data=data, headers=headers)
|
||||||
|
remove(path)
|
||||||
url = res.json()["image"]["url"]
|
url = res.json()["image"]["url"]
|
||||||
button = [
|
button = [
|
||||||
[InlineKeyboardButton("Open Link", url=url)],
|
[InlineKeyboardButton("Open Link", url=url)],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue