diff --git a/app/modules/yd_dl.py b/app/modules/yd_dl.py index 195213f..345b03a 100644 --- a/app/modules/yd_dl.py +++ b/app/modules/yd_dl.py @@ -67,6 +67,7 @@ class YoutubeDLModule(niobot.Module): "merge_output_format": "webm/mp4/mov/m4a/oga/ogg/mp3/mka/mkv", "source_address": "0.0.0.0", "concurrent_fragment_downloads": 4, + "max_filesize": "600M" } async def convert_to_m4a(self, file: Path) -> Path: @@ -249,6 +250,9 @@ class YoutubeDLModule(niobot.Module): description += "\n" description += "\n".join(lines) + if filesize and filesize >= 500 * 1000: + return await response.edit("Sorry, could not find a format small enough.") + await response.edit( f"# {title}\n\n{description}\n\nProgress: `0% [..........]`\n\nDownloading (step 2/10)" )