diff --git a/common/src/main/java/com/github/twitch4j/common/util/AlternativeInstantDeserializer.java b/common/src/main/java/com/github/twitch4j/common/util/AlternativeInstantDeserializer.java index 6243a45fd..60504c980 100644 --- a/common/src/main/java/com/github/twitch4j/common/util/AlternativeInstantDeserializer.java +++ b/common/src/main/java/com/github/twitch4j/common/util/AlternativeInstantDeserializer.java @@ -17,6 +17,15 @@ public Instant deserialize(JsonParser p, DeserializationContext ctxt) throws IOE str = str.trim(); + // Accounts for https://github.com/twitchdev/issues/issues/644 + if (str.startsWith("seconds:")) { + int startIndex = "seconds:".length(); + int endIndex = str.indexOf(' ', startIndex + 1); + String seconds = str.substring(startIndex, endIndex > 0 ? endIndex : str.length()); + return Instant.ofEpochSecond(Integer.parseInt(seconds)); + } + + // Accounts for https://github.com/twitchdev/issues/issues/347 if (str.endsWith(" +0000 UTC")) str = str.substring(0, str.length() - " +0000 UTC".length()) + "Z";