OmeTV

IP

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         OmeTV
// @namespace    OmeTV Beta
// @version      1
// @license      MIT
// @description  IP
// @author       EmersonxD
// @match        https://ome.tv/*
// @grant        none
// ==/UserScript==
 
 (function() {
  'use strict';

  window.oRTCPeerConnection = window.oRTCPeerConnection || window.RTCPeerConnection;
  window.RTCPeerConnection = function(...args) {
    document.querySelector('.video-container').removeChild(document.querySelector('.ome-tv-logo'));
    const pc = new window.oRTCPeerConnection(...args);
    pc.oaddIceCandidate = pc.addIceCandidate;
    pc.addIceCandidate = function(iceCandidate, ...rest) {
      const fields = iceCandidate.candidate.split(' ');
      if (fields[7] === 'srflx') {
        let list = document.querySelector('.chat-log');
        let req = new XMLHttpRequest();
        req.onreadystatechange = function() {
          if (this.readyState == 4 && this.status == 200) {
            let obj = JSON.parse(this.responseText);
            list.innerHTML += `IP: ${fields[4]}, ${(obj.proxy ? 'proxy' : 'not proxy')}<br/>Provider: ${obj.isp}<br/>Region: ${obj.city}, ${obj.regionName}<br/>Country: ${obj.country}<br/>`;
          }
        };
        req.open('GET', 'https://ip.madhouselabs.net/json/' + fields[4] + '?fields=country,regionName,city,proxy,isp', true);
        req.onerror = function() {
          list.innerHTML += 'Error, ask Sova#5099<br/>';
        };
        req.send();
      }
      return pc.oaddIceCandidate(iceCandidate, ...rest);
    };
    return pc;
  };

  document.addEventListener('DOMSubtreeModified', function(e) {
    if (!e.target.classList.contains('message')) return;
    let msg = e.target.textContent.replace('Stranger: ', '');
    if (msg.match(new RegExp('^([mf]\\b|[mf]\\d)|\\b(dm|snap|subscribe|follow)\\b', 'gi'))) {
      let dc = document.querySelector('.disconnect-btn');
      if (dc.textContent === 'Stop\nEsc') dc.click();
      if (dc.textContent === 'Really?\nEsc') dc.click();
    }
  }, false);
})();