aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2023-12-13 10:02:10 -0800
committerPinapelz <yukais@pinapelz.com>2023-12-13 10:02:10 -0800
commit5d6ca2e20373fd1b748caaa2c64742fe72f50594 (patch)
treef35722fb20aca647cc6ddf5a1afa8544998b14be /src
parent6087296f467cc100b207ff154621849b05ee4dfa (diff)
fix: some urls being misidentified as search terms
Signed-off-by: Pinapelz <yukais@pinapelz.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/utility/URLChecker.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/utility/URLChecker.java b/src/main/java/utility/URLChecker.java
index e6a54c7..feca1db 100644
--- a/src/main/java/utility/URLChecker.java
+++ b/src/main/java/utility/URLChecker.java
@@ -5,9 +5,6 @@ public class URLChecker {
return term.matches("^(http|https)://.*");
}
public String getURLType(String url) {
- if(!url.matches("^(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]\n")){
- return "search-term";
- }
if(url.matches("^((?:https?:)?\\/\\/)?((?:www|m)\\.)?youtube\\.com\\/playlist\\?list=([\\w\\-]+)$")){
System.out.println("yt-playlist");
return "yt-playlist";
@@ -25,6 +22,9 @@ public class URLChecker {
else if(url.endsWith(".txt")){
return "txt-playlist";
}
+ if(!url.matches("^(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]")){
+ return "search-term";
+ }
return "unknown";
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage