diff --git a/src/cogs/screenshot.py b/src/cogs/screenshot.py index 3d28939..c5b7965 100644 --- a/src/cogs/screenshot.py +++ b/src/cogs/screenshot.py @@ -62,7 +62,7 @@ class ScreenshotCog(commands.Cog): img.save(file.name, "webp", quality=quality_r) file.seek(0) value = io.BytesIO(file.read()) - if len(value.getvalue()) <= 24 * 1024 * 1024: + if len(value.getvalue()) <= 8 * 1024 * 1024: self.log.debug("%d%% was sufficient.", quality_r) break quality -= 15 @@ -179,7 +179,7 @@ class ScreenshotCog(commands.Cog): file.seek(0) end_save = time.time() - if len(await asyncio.to_thread(file.getvalue)) > 24 * 1024 * 1024: + if len(await asyncio.to_thread(file.getvalue)) > 8 * 1024 * 1024: await ctx.edit(content="Compressing screenshot...") start_compress = time.time() file = await asyncio.to_thread(self.compress_png, file) diff --git a/src/cogs/ytdl.py b/src/cogs/ytdl.py index 42888f3..0dad7fb 100644 --- a/src/cogs/ytdl.py +++ b/src/cogs/ytdl.py @@ -43,7 +43,7 @@ class YTDLCog(commands.Cog): "noprogress": True, "logger": self.log, "format": "((bv+ba/b)[vcodec!=h265][vcodec!=av01][filesize<15M]/b[filesize<=15M]/b)", - "outtmpl": f"%(title).50s.%(ext)s", + "outtmpl": "%(title).50s.%(ext)s", "format_sort": [ "vcodec:h264", "acodec:aac", @@ -60,6 +60,7 @@ class YTDLCog(commands.Cog): } self.colours = { "youtube.com": 0xff0000, + "youtu.be": 0xff0000, "tiktok.com": 0x25F5EF, "instagram.com": 0xe1306c, "shronk.net": 0xFFF952 @@ -318,7 +319,7 @@ class YTDLCog(commands.Cog): title = extracted_info.get("title", url) title = textwrap.shorten(title, 100) thumbnail_url = extracted_info.get("thumbnail") or None - webpage_url = extracted_info.get("webpage_url") or None + webpage_url = extracted_info.get("webpage_url", url) chosen_format = extracted_info.get("format") chosen_format_id = extracted_info.get("format_id")