aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/utility/URLChecker.java
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2023-12-13 09:54:30 -0800
committerPinapelz <yukais@pinapelz.com>2023-12-13 09:54:30 -0800
commit6087296f467cc100b207ff154621849b05ee4dfa (patch)
treeb78d614e9f5b0cb55182039bab0e179fe652ab4e /src/main/java/utility/URLChecker.java
parent4fe931bf1f1eaa5783d5081b9beb2f47b35d0259 (diff)
Re-add support for using /play with YT search terms
Signed-off-by: Pinapelz <yukais@pinapelz.com>
Diffstat (limited to 'src/main/java/utility/URLChecker.java')
-rw-r--r--src/main/java/utility/URLChecker.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/utility/URLChecker.java b/src/main/java/utility/URLChecker.java
index 99eb651..e6a54c7 100644
--- a/src/main/java/utility/URLChecker.java
+++ b/src/main/java/utility/URLChecker.java
@@ -5,6 +5,9 @@ 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";
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage