update to 500mb limit on upload

This commit is contained in:
Zodiac 2025-02-13 19:29:24 -08:00
parent ea4d5365db
commit 5a0d99744f

View File

@ -4,7 +4,7 @@ IRC Bot Plugin for Uploading Files to hardfiles.org
This plugin allows users to upload files to hardfiles.org using yt-dlp for downloads.
It supports downloading files from various sources (YouTube, Instagram, etc.) and can
optionally convert videos to MP3 format before uploading. Files larger than 100MB are rejected.
optionally convert videos to MP3 format before uploading. Files larger than 500MB are rejected.
Usage:
!upload [--mp3] <url_or_search_term>...
@ -114,7 +114,7 @@ class UploadPlugin:
@command
async def upload(self, mask, target, args):
"""
Upload a file to hardfiles.org (Max 100MB).
Upload a file to hardfiles.org (Max 500MB).
Args:
mask (str): The user mask (nickname@host) of the command issuer.
@ -174,7 +174,7 @@ class UploadPlugin:
target (str): The channel or user to send messages to.
mp3 (bool): Whether to convert the downloaded file to MP3.
"""
max_size = 100 * 1024 * 1024 # 100MB limit
max_size = 500 * 1024 * 1024 # 500MB limit
with tempfile.TemporaryDirectory() as tmp_dir:
parsed_url = urlparse(url)
@ -214,7 +214,7 @@ class UploadPlugin:
self.bot.privmsg(
target,
ircstyle.style(
f"File size ({int(content_length) // (1024 * 1024)}MB) exceeds 100MB limit",
f"File size ({int(content_length) // (1024 * 1024)}MB) exceeds 500MB limit",
fg="red",
bold=True,
reset=True,
@ -281,7 +281,7 @@ class UploadPlugin:
self.bot.privmsg(
target,
ircstyle.style(
f"File size ({estimated_size // (1024 * 1024)}MB) exceeds 100MB limit",
f"File size ({estimated_size // (1024 * 1024)}MB) exceeds 500MB limit",
fg="red",
bold=True,
reset=True,
@ -389,7 +389,7 @@ class UploadPlugin:
self.bot.privmsg(
target,
ircstyle.style(
f"File size ({file_size // (1024 * 1024)}MB) exceeds 100MB limit",
f"File size ({file_size // (1024 * 1024)}MB) exceeds 500MB limit",
fg="red",
bold=True,
reset=True,