【问题标题】:How to get address/location of a random person on omegle? [closed]如何在 omegle 上获取随机人的地址/位置? [关闭]
【发布时间】:2021-10-06 11:11:15
【问题描述】:

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

【问题讨论】:

    标签: javascript geolocation location ip-address


    【解决方案1】:

    这只是为了教育目的

    1. 您需要一个能够根据 IP 地址提供地址的 API。转到https://ipgeolocation.io/,免费注册,获取密钥,并在 URL 中的 YOURKEY 处替换以下代码。
    2. 转到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);
    
    })
    );
    };
    
    
    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-09-29
      • 2011-10-26
      • 1970-01-01
      • 1970-01-01
      • 2014-06-09
      • 2017-08-14
      • 2014-02-25
      相关资源
      最近更新 更多