diff --git a/src/main/java/io/github/yajuhua/invidious/dlj/command/CommandLineParser.java b/src/main/java/io/github/yajuhua/invidious/dlj/command/CommandLineParser.java index b12dade..5d4a737 100644 --- a/src/main/java/io/github/yajuhua/invidious/dlj/command/CommandLineParser.java +++ b/src/main/java/io/github/yajuhua/invidious/dlj/command/CommandLineParser.java @@ -8,6 +8,7 @@ import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.net.InetSocketAddress; +import java.net.MalformedURLException; import java.net.Proxy; import java.net.URL; import java.util.*; @@ -73,6 +74,14 @@ public static CommandInfo parse(String[] args) throws Exception { removeOptionFromArgs(argList,optionName,field); } } + + //去掉命令尾部的URL链接,如果有的话 + try { + new URL(argList.get(argList.size() - 1)); + argList.remove(argList.size() - 1);//去掉尾部链接 + } catch (MalformedURLException ignored) { + + } return commandInfo; }