mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-09-05 23:56:50 +08:00
Add comprehensive tests for ytdlp parameter parsing
Co-authored-by: krau <71133316+krau@users.noreply.github.com>
This commit is contained in:
co-authored by
krau
parent
9ee9972dec
commit
1b9c8cd2ad
@@ -27,13 +27,13 @@ func handleYtdlpCmd(ctx *ext.Context, update *ext.Update) error {
|
||||
// Separate URLs and flags from arguments
|
||||
var urls []string
|
||||
var flags []string
|
||||
|
||||
|
||||
for i := 1; i < len(args); i++ {
|
||||
arg := strings.TrimSpace(args[i])
|
||||
if arg == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
// Check if it's a flag (starts with - or --)
|
||||
if strings.HasPrefix(arg, "-") {
|
||||
flags = append(flags, arg)
|
||||
|
||||
Reference in New Issue
Block a user