update to 500mb limit on upload
This commit is contained in:
parent
ea4d5365db
commit
5a0d99744f
@ -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.
|
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
|
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:
|
Usage:
|
||||||
!upload [--mp3] <url_or_search_term>...
|
!upload [--mp3] <url_or_search_term>...
|
||||||
@ -114,7 +114,7 @@ class UploadPlugin:
|
|||||||
@command
|
@command
|
||||||
async def upload(self, mask, target, args):
|
async def upload(self, mask, target, args):
|
||||||
"""
|
"""
|
||||||
Upload a file to hardfiles.org (Max 100MB).
|
Upload a file to hardfiles.org (Max 500MB).
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
mask (str): The user mask (nickname@host) of the command issuer.
|
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.
|
target (str): The channel or user to send messages to.
|
||||||
mp3 (bool): Whether to convert the downloaded file to MP3.
|
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:
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||||
parsed_url = urlparse(url)
|
parsed_url = urlparse(url)
|
||||||
@ -214,7 +214,7 @@ class UploadPlugin:
|
|||||||
self.bot.privmsg(
|
self.bot.privmsg(
|
||||||
target,
|
target,
|
||||||
ircstyle.style(
|
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",
|
fg="red",
|
||||||
bold=True,
|
bold=True,
|
||||||
reset=True,
|
reset=True,
|
||||||
@ -281,7 +281,7 @@ class UploadPlugin:
|
|||||||
self.bot.privmsg(
|
self.bot.privmsg(
|
||||||
target,
|
target,
|
||||||
ircstyle.style(
|
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",
|
fg="red",
|
||||||
bold=True,
|
bold=True,
|
||||||
reset=True,
|
reset=True,
|
||||||
@ -389,7 +389,7 @@ class UploadPlugin:
|
|||||||
self.bot.privmsg(
|
self.bot.privmsg(
|
||||||
target,
|
target,
|
||||||
ircstyle.style(
|
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",
|
fg="red",
|
||||||
bold=True,
|
bold=True,
|
||||||
reset=True,
|
reset=True,
|
||||||
|
Loading…
Reference in New Issue
Block a user