From 62b1402271c23fd7c382a4e4aaee50f482987beb Mon Sep 17 00:00:00 2001 From: yajuhua Date: Mon, 16 Sep 2024 23:31:55 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=8E=BB=E6=8E=89=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=B0=BE=E9=83=A8=E7=9A=84URL=E9=93=BE=E6=8E=A5=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=9C=89=E7=9A=84=E8=AF=9D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yajuhua/invidious/dlj/command/CommandLineParser.java | 9 +++++++++ 1 file changed, 9 insertions(+) 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; }