我正在嘗試使用此處找到的Omegle Java API:https://github.com/nikkiii/omegle-api-java。但是,下面的代碼:Java API不起作用
package me.nrubin29.pollmegle;
import org.nikki.omegle.Omegle;
import org.nikki.omegle.core.OmegleMode;
import org.nikki.omegle.core.OmegleSession;
import org.nikki.omegle.core.OmegleSpyStranger;
import org.nikki.omegle.event.OmegleEventAdaptor;
import java.util.Map;
public class Pollmegle {
public static void main(String[] args) {
Omegle omegle = new Omegle();
final String question = "Yes or no?";
System.out.println(question);
try {
OmegleSession session = omegle.openSession(OmegleMode.SPY_QUESTION, question, new OmegleEventAdaptor() {
@Override
public void chatWaiting(OmegleSession session) {
System.out.println("Waiting for chat...");
}
@Override
public void chatConnected(OmegleSession session) {
System.out.println("You are now watching two strangers talk about \"" + question + "\"!");
}
@Override
public void spyMessage(OmegleSession session, OmegleSpyStranger stranger, String message) {
System.out.println(stranger + ": " + message);
}
@Override
public void spyDisconnected(OmegleSession session, OmegleSpyStranger stranger) {
System.out.println("Stranger "+stranger+" disconnected, goodbye!");
System.exit(0);
}
@Override
public void question(OmegleSession session, String question) {
System.out.println("Question: "+question);
}
@Override
public void omegleError(OmegleSession session, String string) {
System.out.println("ERROR! " + string);
System.exit(1);
}
@Override
public void recaptchaRequired(OmegleSession session, Map<String, Object> variables) {
System.out.print("Required // ");
for (String var : variables.keySet()) {
System.out.println(var + " // " + variables.get(var));
}
}
@Override
public void recaptchaRejected(OmegleSession session, Map<String, Object> variables) {
System.out.println("Rejected // ");
for (String var : variables.keySet()) {
System.out.println(var + " // " + variables.get(var));
}
}
});
System.out.println("Session " + session.getId() + " created.");
omegle.setEventParseDelay(1000);
omegle.run();
}
catch (Exception e) { e.printStackTrace(); }
}
}
息率這樣的結果:
是或否?
所需// 6Led7gkAAAAAAEAyh-Kt7HTb_oC0chDvQIZ8VtQb //空
會議central1:znv479i7a5sh2u60z5sg6s2nzm6jpb創建。
我在做什麼錯?我需要通過驗證碼嗎?
你可能會更好地提出一個關於github項目的問題:https://github.com/nikkiii/omegle-api-java/issues – Catchwa
該項目在9個月內沒有被觸及,但我想我可以提交問題。 – nrubin29