OmeTV Virtual Camera Unblock

Use OBS and other virtual cameras on ome.tv without getting blocked.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

Advertisement:

// ==UserScript==
// @name         OmeTV Virtual Camera Unblock
// @namespace    sobakintech
// @version      1
// @author       sobakintech
// @description  Use OBS and other virtual cameras on ome.tv without getting blocked.
// @homepage     https://github.com/sobakintech/ome.tv-userscript
// @supportURL   https://github.com/sobakintech/ome.tv-userscript/issues
// @match        *://ome.tv/*
// @match        *://*.ome.tv/*
// @grant        none
// @run-at       document-start
// ==/UserScript==

(function() {
	"use strict";
	var alwaysValid = () => true;
	var neverSuspicious = () => false;
	function neutralize(fcn) {
		if (!fcn || typeof fcn !== "function" && typeof fcn !== "object") return fcn;
		if (fcn.__omeUnblocked) return fcn;
		try {
			Object.defineProperty(fcn, "isValid", {
				configurable: true,
				enumerable: false,
				writable: true,
				value: alwaysValid
			});
			Object.defineProperty(fcn, "isSuspicious", {
				configurable: true,
				enumerable: false,
				writable: true,
				value: neverSuspicious
			});
			Object.defineProperty(fcn, "__omeUnblocked", {
				value: true,
				configurable: true
			});
		} catch (e) {
			try {
				fcn.isValid = alwaysValid;
				fcn.isSuspicious = neverSuspicious;
			} catch (e2) {}
		}
		return fcn;
	}
	function patchManyCamLabel() {
		const proto = window.MediaStreamTrack && window.MediaStreamTrack.prototype;
		if (!proto) return;
		const desc = Object.getOwnPropertyDescriptor(proto, "label");
		if (!desc || !desc.get || desc.get.__omeManyCam || !desc.configurable) return;
		const realGet = desc.get;
		const get = function() {
			const label = realGet.call(this);
			return typeof label === "string" && /manycam/i.test(label) ? label.replace(/manycam/gi, "Camera") : label;
		};
		get.__omeManyCam = true;
		Object.defineProperty(proto, "label", {
			...desc,
			get
		});
	}
	function installShim() {
		patchManyCamLabel();
		if (window.FCN) neutralize(window.FCN);
		let current = window.FCN;
		try {
			Object.defineProperty(window, "FCN", {
				configurable: true,
				get() {
					return current;
				},
				set(v) {
					current = neutralize(v);
				}
			});
		} catch (e) {
			let tries = 0;
			const id = setInterval(() => {
				if (window.FCN) {
					neutralize(window.FCN);
					clearInterval(id);
				} else if (++tries > 200) clearInterval(id);
			}, 50);
		}
	}
	installShim();
})();