diff --git a/LICENSE b/LICENSE index 5ff6e2c..96a2fa2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 aNNiMON +Copyright (c) 2023-2025 aNNiMON Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/main/java/com/annimon/ffmpegbot/commands/HelpCommand.java b/src/main/java/com/annimon/ffmpegbot/commands/HelpCommand.java index 7987a43..337dc57 100644 --- a/src/main/java/com/annimon/ffmpegbot/commands/HelpCommand.java +++ b/src/main/java/com/annimon/ffmpegbot/commands/HelpCommand.java @@ -55,7 +55,7 @@ public void accept(@NotNull MessageContext ctx) { yt-dlp /dl link [format] — download a media using yt-dlp link — a link to download (it must be supported by yt-dlp) - format — (optional) a download format. Can be: best, audio, 240, 360, 480, 720 or 1080. Default: best + format — (optional) a download format. Can be: best, audio, 240, 360, 480, 720 or 1080. Default: 1080 /clip link [duration] [format] — make a clip using yt-dlp (intended for streams) link — yt-dlp supported link, livestreams intended such as twitch duration — (optional) duration in seconds. Max: 199, min: 10, default: 20 diff --git a/src/main/java/com/annimon/ffmpegbot/commands/ytdlp/YtDlpCommandBundle.java b/src/main/java/com/annimon/ffmpegbot/commands/ytdlp/YtDlpCommandBundle.java index 6a6052a..2904825 100644 --- a/src/main/java/com/annimon/ffmpegbot/commands/ytdlp/YtDlpCommandBundle.java +++ b/src/main/java/com/annimon/ffmpegbot/commands/ytdlp/YtDlpCommandBundle.java @@ -26,6 +26,8 @@ public class YtDlpCommandBundle implements CommandBundle { + private static final String DEFAULT_FORMAT = "1080"; + private final Sessions sessions; public YtDlpCommandBundle(Sessions sessions) { @@ -64,7 +66,7 @@ private void clip(@NotNull RegexMessageContext ctx) { .orElse(20); final String downloadOption = Optional.ofNullable(ctx.group(3)) .filter(Predicate.not(String::isBlank)) - .orElse("best"); + .orElse(DEFAULT_FORMAT); final var session = createYtDlpSession(ctx.chatId(), url, downloadOption, duration); session.setMessageId(ctx.messageId()); @@ -80,7 +82,7 @@ private void download(@NotNull RegexMessageContext ctx) { final String url = ctx.group(1); final String downloadOption = Optional.ofNullable(ctx.group(2)) .filter(Predicate.not(String::isBlank)) - .orElse("best"); + .orElse(DEFAULT_FORMAT); final int maxDuration = 10 * 60 * 60; final var session = createYtDlpSession(ctx.chatId(), url, downloadOption, maxDuration);