aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/Danker/handlers/APIHandler.java
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-04-20 09:00:05 -0400
committerbowser0000 <bowser0000@gmail.com>2021-04-20 09:00:05 -0400
commite1fb5cf460f95fc7fadab9b167531b8380d0caf1 (patch)
tree4f3290822580ecaad19c0075fc08c45fde32de8e /src/main/java/me/Danker/handlers/APIHandler.java
parent4e4bc07819f595107ad23d2bb003f518d1344ec5 (diff)
downloadSkyblockMod-e1fb5cf460f95fc7fadab9b167531b8380d0caf1.tar.gz
SkyblockMod-e1fb5cf460f95fc7fadab9b167531b8380d0caf1.tar.bz2
SkyblockMod-e1fb5cf460f95fc7fadab9b167531b8380d0caf1.zip
Add /player
Diffstat (limited to 'src/main/java/me/Danker/handlers/APIHandler.java')
-rw-r--r--src/main/java/me/Danker/handlers/APIHandler.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/handlers/APIHandler.java b/src/main/java/me/Danker/handlers/APIHandler.java
index c9460fe..66001a3 100644
--- a/src/main/java/me/Danker/handlers/APIHandler.java
+++ b/src/main/java/me/Danker/handlers/APIHandler.java
@@ -25,6 +25,7 @@ public class APIHandler {
URL url = new URL(urlString);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
+ conn.setRequestProperty("User-Agent", "Dsm/1.0");
if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
@@ -40,7 +41,7 @@ public class APIHandler {
return gson.fromJson(response.toString(), JsonObject.class);
} else {
- if (urlString.startsWith("https://api.hypixel.net/")) {
+ if (urlString.startsWith("https://api.hypixel.net/") || urlString.startsWith("https://hypixel-api.senither.com")) {
InputStream errorStream = conn.getErrorStream();
try (Scanner scanner = new Scanner(errorStream)) {
scanner.useDelimiter("\\Z");