Update mediainfo_paste.py

This commit is contained in:
Yasir Aris M 2024-09-04 14:27:20 +07:00 committed by GitHub
parent 31af4fc83c
commit 254a954e68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,151 +1,3 @@
css = """
<style>
@font-face {
font-family: 'JetBrainsMono';
src: url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff2/JetBrainsMono-Regular.woff2') format('woff2'),
url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/web/woff/JetBrainsMono-Regular.woff') format('woff'),
url('https://cdn.jsdelivr.net/gh/JetBrains/JetBrainsMono/ttf/JetBrainsMono-Regular.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
.loader-pulse {
position: relative;
bottom: 0.17rem;
width: 25px;
height: 25px;
float: left;
border-radius: 50%;
background: #50fa7b;
animation: load-pulse 1s infinite linear;
}
@keyframes load-pulse {
0% {
transform: scale(0.05);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
transform: scale(0.5);
opacity: 0;
}
}
::-webkit-scrollbar {
width: 3px;
height: 3px;
}
::-webkit-scrollbar-corner ,
::-webkit-scrollbar-track {
display: none;
}
::-webkit-scrollbar-thumb {
border-radius: 8px;
background-color: #50fa7b;
}
body {
background-color: #282a36;
font-family: "Josefin Sans", sans-serif;
color: #f8f8f2;
overscroll-behaviour: contain;
}
code {
font-family: "Ubuntu mono", "Courier prime";
}
.container {
display: flex;
flex-direction: column;
}
.container.heading {
display: block;
text-align: center;
line-height: 20px;
flex-direction: column;
margin: auto;
margin-bottom: 50px;
padding: 20px 20px 20px 20px;
font-size: 1rem;
overflow: scroll;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 7px;
border-style: dashed;
font-family: "Ubuntu mono", "Courier prime";
border: 2px solid rgba(255, 255, 255, 0.1);
}
.container.heading::-webkit-scrollbar {
display: none;
}
.container.subheading {
margin-left: 15px;
margin-bottom:15px;
padding-top: 10px;
font-size: 1.4rem;
}
.container.infobox {
margin-bottom: 40px;
margin-left: 12px;
margin-right: 12px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.1);
border: 2.5px solid rgba(255, 255, 255, 0.1);
padding: 10px 15px 15px 10px;
white-space: pre ;
overflow: scroll;
font-size: 0.9rem;
}
.subtitle {
display: grid;
grid-auto-flow: column;
grid-auto-columns:320px;
overflow-x: auto;
overscroll-behaviour-inline: contain;
margin-bottom: 40px;
margin-left: 7px;
margin-top: 12px;
}
.subtitle::-webkit-scrollbar {
display: none;
}
.container.subtitlebox {
margin-left: 5px;
margin-right: 15px;
margin-bottom: 0px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.1);
border: 3px solid rgba(255, 255, 255, 0.1);
padding: 15px 15px 15px 10px;
white-space: nowrap;
overflow: scroll;
font-size: 0.9rem;
}
.icons {
float: left;
margin-left: 15px;
margin-right: 5px;
}
.footer {
position: fixed;
bottom: 0;
right: 0;
left: 0;
height: 32px;
width: 100%;
font-family: JetBrainsMono;
background-color: #212121;
}
.footer-text{
display: block;
justify-content: space-between;
font-size: 0.9rem;
padding-left: 0.7rem;
padding-right: 1.5rem;
padding-top: 0.25rem;
}
</style>
</head>
"""
import json
import re
@ -214,7 +66,7 @@ def html_builder(title: str, text: str) -> str:
html_msg += "</span>"
html_msg += "</span>"
return css + html_msg
return html_msg
async def mediainfo_paste(text: str, title: str) -> str: