diff --git a/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateHttpClient.java b/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateHttpClient.java index 37f2697e..e48671f1 100644 --- a/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateHttpClient.java +++ b/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateHttpClient.java @@ -4,7 +4,9 @@ import static ctbrec.io.HttpConstants.*; import java.io.IOException; import java.util.NoSuchElementException; +import java.util.Objects; +import org.jsoup.nodes.Element; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -110,8 +112,8 @@ public class ChaturbateHttpClient extends HttpClient { if (resp.isSuccessful()) { String profilePage = resp.body().string(); try { - HtmlParser.getText(profilePage, "span.tokencount"); - return true; + Element userIcon = HtmlParser.getTag(profilePage, "img.user_information_header_icon"); + return !Objects.equals("Anonymous Icon", userIcon.attr("alt")); } catch(Exception e) { LOG.debug("Token tag not found. Login failed"); return false;