Quick wins: Lower default volume to 25% and add file upload support

- Scale volume by 0.25x to prevent earrape (user still sees 0-200%)
  - Add support for direct audio file URL links (.mp3, .mp4, etc.)
  - New =playfile command for Discord file uploads
  - Supports MP3, MP4, WAV, OGG, FLAC, M4A, WEBM, AAC, OPUS formats
This commit is contained in:
2025-11-29 17:02:15 +00:00
parent 125c9e53eb
commit d8952577ad
6 changed files with 930 additions and 359 deletions

View File

@@ -27,7 +27,7 @@ async def main(url, sp):
#url = url.lower()
# Check if link or search
if url.startswith("https://") is False:
if not url.startswith("https://") and not url.startswith("http://"):
return await search_song(url)
#TODO add better regex or something
@@ -44,7 +44,14 @@ async def main(url, sp):
youtube_song = 'watch?v=' in url or 'youtu.be/' in url
youtube_playlist = 'playlist?list=' in url
if soundcloud_song or youtube_song:
# Check for direct audio/video file URLs
# Supported formats: mp3, mp4, wav, ogg, flac, m4a, webm, aac, opus
audio_extensions = ('.mp3', '.mp4', '.wav', '.ogg', '.flac', '.m4a', '.webm', '.aac', '.opus')
is_direct_file = any(url.lower().endswith(ext) for ext in audio_extensions)
# Also check for URLs with query parameters (e.g., file.mp3?download=true)
is_direct_file = is_direct_file or any(ext in url.lower() for ext in audio_extensions)
if soundcloud_song or youtube_song or is_direct_file:
return await song_download(url)
if youtube_playlist: