Fix yt-dlp

This commit is contained in:
EEKIM10 2023-03-14 20:37:18 +00:00
parent 5436e72e72
commit 2b7804b22a
3 changed files with 18 additions and 4 deletions

View file

@ -750,7 +750,7 @@ class OtherCog(commands.Cog):
options = [ options = [
"--no-colors", "--no-colors",
"--no-playlist", "--no-playlist",
"--max-filesize", str(MAX_SIZE) + "M", # "--max-filesize", str(MAX_SIZE) + "M",
"--no-warnings", "--no-warnings",
"--output", OUTPUT_FILE, "--output", OUTPUT_FILE,
] ]
@ -795,9 +795,14 @@ class OtherCog(commands.Cog):
stderr_log_file stderr_log_file
] if upload_log else [] ] if upload_log else []
for file_name in Path(tempdir).glob(f"{ctx.user.id}.*"): for file_name in Path(tempdir).glob(f"{ctx.user.id}.*"):
stat = file_name.stat()
size_mb = stat.st_size / 1024 ** 2
if size_mb > MAX_SIZE - 0.1:
_x = io.BytesIO(f"File {file_name.name} was too large ({size_mb:,.1f}MB vs {MAX_SIZE:.1f}MB)".encode())
files.append(discord.File(_x, filename=file_name.name + ".txt"))
try: try:
async with aiofiles.open(file_name) as file: with open(file_name) as file:
video = discord.File(await file.read(), filename=file_name.name) video = discord.File(file, filename=file_name.name)
files.append(video) files.append(video)
except FileNotFoundError: except FileNotFoundError:
continue continue

View file

@ -28014,3 +28014,12 @@ kekma.net
dogehls.xyz dogehls.xyz
nhentai.com nhentai.com
fast.com fast.com
cup.shronkservz.tk
.+.archive.org
(.+\.)*reddit.com
.+\.shronkservz.tk
.+.github.io
.+.ca
cakefarts.org
newscatinbrazil.com
tubgirl.ca

View file

@ -18,7 +18,7 @@ GENERAL = "https://ptb.discord.com/channels/994710566612500550/10189153423172772
OAUTH_ENABLED = OAUTH_ID and OAUTH_SECRET and OAUTH_REDIRECT_URI OAUTH_ENABLED = OAUTH_ID and OAUTH_SECRET and OAUTH_REDIRECT_URI
app = FastAPI() app = FastAPI(root_path="/jimmy")
app.state.bot = None app.state.bot = None
app.state.states = set() app.state.states = set()
app.state.http = httpx.Client() app.state.http = httpx.Client()