mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-06 20:04:51 +00:00
Typo
This commit is contained in:
parent
af2b4fdf9e
commit
3051159d20
4 changed files with 6 additions and 110 deletions
|
|
@ -1,97 +0,0 @@
|
|||
import base64, json, os
|
||||
from .tools import get_random_string
|
||||
from .http import http
|
||||
from misskaty.vars import GH_TOKEN
|
||||
|
||||
hmtl_content = """
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{title}t</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap"
|
||||
rel="stylesheet" />
|
||||
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" />
|
||||
<style>
|
||||
* {
|
||||
font-family: "Ubuntu", sans-serif;
|
||||
list-style: none;
|
||||
text-decoration: none;
|
||||
outline: none !important;
|
||||
color: white;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
body {
|
||||
background-color: #0D1117;
|
||||
}
|
||||
.container {
|
||||
margin-bottom: 1vh;
|
||||
padding: 1vh 3vw;
|
||||
display: list-item;
|
||||
flex-direction: column;
|
||||
border: 2px solid rgba(255, 255, 255, 0.11);
|
||||
border-radius: 20px;
|
||||
background-color: #161b22;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
.container.center {
|
||||
text-align: center;
|
||||
}
|
||||
.container.start {
|
||||
text-align: start;
|
||||
}
|
||||
.rfontsize {
|
||||
font-size: 1rem;
|
||||
}
|
||||
.forhover:hover {
|
||||
filter: invert(0.3);
|
||||
}
|
||||
.dlinks {
|
||||
margin-top: 2.5vh;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
{msg}
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
|
||||
async def postToWeb(file, name):
|
||||
fpath = base64.b64encode(open(file, "rb").read())
|
||||
|
||||
headers = {
|
||||
'Accept': 'application/vnd.github+json',
|
||||
'Authorization': f'Bearer {GH_TOKEN}',
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
}
|
||||
|
||||
data = {"message":"Added new HTML File","committer":{"name":"Yasir Aris M","email":"mail@yasir.eu.org"},"content": f"{fpath.decode('ascii')}"}
|
||||
|
||||
response = await http.put(f"https://api.github.com/repos/yasirarism/HTMLPaste/contents/{name}.html", headers=headers, data=json.dumps(data))
|
||||
return f"https://yasirarism.github.io/HTMLPaste/{name}"
|
||||
|
||||
async def getMediaWeb(title, text):
|
||||
mssg = ""
|
||||
fname = get_random_string(7)
|
||||
mssg += '<span class="container center rfontsize">' \
|
||||
f'<h4>{title}</h4></span>'
|
||||
mssg += '<span class="container center rfontsize">' \
|
||||
f'<b>MediaInfo</b></span>'
|
||||
mssg += '<span class="container start rfontsize">' \
|
||||
f"<div>{text}</div></span>"
|
||||
with open(f"{fname}.html", 'w', encoding='utf-8') as f:
|
||||
f.write(hmtl_content.replace('{msg}', mssg))
|
||||
try:
|
||||
res = await postToWeb(f"{fname}.html", fname)
|
||||
os.remove(f"{fname}.html")
|
||||
return res
|
||||
except:
|
||||
return None
|
||||
|
|
@ -19,7 +19,7 @@ from misskaty import app, DL_TASK
|
|||
from misskaty.helper.html_view import getMediaWeb
|
||||
from misskaty.helper.media_helper import post_to_telegraph, runcmd
|
||||
from misskaty.helper.pyro_progress import progress_for_pyrogram
|
||||
from misskaty.vars import COMMAND_HANDLER, CUSTOM_VIEW, GH_TOKEN
|
||||
from misskaty.vars import COMMAND_HANDLER
|
||||
from utils import get_file_id
|
||||
|
||||
|
||||
|
|
@ -83,18 +83,10 @@ async def mediainfo(client, message):
|
|||
except Exception:
|
||||
return await process.edit("Sepertinya link yang kamu kirim tidak valid, pastikan direct link dan bisa di download.")
|
||||
title = "MissKaty Bot Mediainfo"
|
||||
if CUSTOM_VIEW and GH_TOKEN is not None:
|
||||
body_text = f"""
|
||||
<pre>{output}</pre>
|
||||
"""
|
||||
link = await getMediaWeb(title, body_text)
|
||||
if not link:
|
||||
return await message.reply("Failed to post mediainfo result.")
|
||||
else:
|
||||
body_text = f"""
|
||||
body_text = f"""
|
||||
<pre>{output}</pre>
|
||||
"""
|
||||
link = post_to_telegraph(title, body_text)
|
||||
link = post_to_telegraph(title, body_text)
|
||||
# siteurl = "https://spaceb.in/api/v1/documents/"
|
||||
# response = await http.post(siteurl, data={"content": output, "extension": 'txt'} )
|
||||
# response = response.json()
|
||||
|
|
|
|||
3
misskaty/plugins/sangmata.py
Normal file
3
misskaty/plugins/sangmata.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from misskaty import app
|
||||
from pyrogram import filters
|
||||
|
||||
|
|
@ -40,8 +40,6 @@ SUDO = list(
|
|||
)
|
||||
SUPPORT_CHAT = environ.get("SUPPORT_CHAT", "YasirPediaChannel")
|
||||
NIGHTMODE = environ.get("NIGHTMODE", False)
|
||||
CUSTOM_VIEW = environ.get("CUSTOM_VIEW", False)
|
||||
GH_TOKEN = environ.get("GH_TOKEN", None)
|
||||
OPENAI_API = getConfig("OPENAI_API")
|
||||
|
||||
## Config For AUtoForwarder
|
||||
|
|
|
|||
Loading…
Reference in a new issue