forked from j62/ctbrec
Don't open login dialog, if login has captcha
The login dialog doesn't work anyways. So it makes more sense to show a reasonable error dialog at the moment.
This commit is contained in:
parent
9b39440190
commit
95a3e2dc79
|
@ -49,8 +49,9 @@ public class CamsodaHttpClient extends HttpClient {
|
||||||
JSONObject resp = new JSONObject(response.body().string());
|
JSONObject resp = new JSONObject(response.body().string());
|
||||||
if(resp.has("error")) {
|
if(resp.has("error")) {
|
||||||
String error = resp.getString("error");
|
String error = resp.getString("error");
|
||||||
if(Objects.equals(error, "Please confirm that you are not a robot.")) {
|
if (Objects.equals(error, "Please confirm that you are not a robot.")) {
|
||||||
return loginWithDialog();
|
//return loginWithDialog();
|
||||||
|
throw new IOException("CamSoda requested to solve a captcha. Please try again in a while (maybe 15 min).");
|
||||||
} else {
|
} else {
|
||||||
throw new IOException(resp.getString("error"));
|
throw new IOException(resp.getString("error"));
|
||||||
}
|
}
|
||||||
|
@ -62,6 +63,7 @@ public class CamsodaHttpClient extends HttpClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private boolean loginWithDialog() throws IOException {
|
private boolean loginWithDialog() throws IOException {
|
||||||
BlockingQueue<Boolean> queue = new LinkedBlockingQueue<>();
|
BlockingQueue<Boolean> queue = new LinkedBlockingQueue<>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue