aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/utility/URLChecker.java
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2023-12-12 20:26:28 -0800
committerPinapelz <yukais@pinapelz.com>2023-12-12 20:26:28 -0800
commit4fe931bf1f1eaa5783d5081b9beb2f47b35d0259 (patch)
tree7c988971ef677b6e5250912eead913e42c74308c /src/main/java/utility/URLChecker.java
parentff3ca04a6480e52bd13d09a3c8261b58d4abe724 (diff)
Add support for any .txt playlists via /play
- Have a newline delimited file of URLs of valid urls - Bot will attempt to queue up to MAX_LIMIT of them Signed-off-by: Pinapelz <yukais@pinapelz.com>
Diffstat (limited to 'src/main/java/utility/URLChecker.java')
-rw-r--r--src/main/java/utility/URLChecker.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/utility/URLChecker.java b/src/main/java/utility/URLChecker.java
index 499cca9..99eb651 100644
--- a/src/main/java/utility/URLChecker.java
+++ b/src/main/java/utility/URLChecker.java
@@ -19,7 +19,10 @@ public class URLChecker {
} else if (url.split("\\?si=")[0].matches("^(https?://)?(www.)?(open.)?spotify.com/(user/[a-zA-Z0-9]+|artist/[a-zA-Z0-9]+|album/[a-zA-Z0-9]+|track/[a-zA-Z0-9]+|playlist/[a-zA-Z0-9]+)$")) {
return url.split("\\?si=")[0].matches("^(https?://)?(www.)?(open.)?spotify.com/playlist/[a-zA-Z0-9]+$") ? "spotify-playlist" : "spotify";
}
- return "unknown";
+ else if(url.endsWith(".txt")){
+ return "txt-playlist";
+ }
+ return "unknown";
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage