Greasy Fork

Pinterest Copyrighted Audio Force Unmute

Forces audio to be unmuted and sets volume to max on pinterest videos that are blocked in specific regions.

当前为 2023-11-29 提交的版本,查看 最新版本

// ==UserScript==
// @name         Pinterest Copyrighted Audio Force Unmute
// @namespace    http://tampermonkey.net/
// @version      1.0
// @license      MIT
// @description  Forces audio to be unmuted and sets volume to max on pinterest videos that are blocked in specific regions.
// @author       Bonkeyzz
// @match     https://*.pinterest.com/*
// @match     https://*.pinterest.at/*
// @match     https://*.pinterest.ca/*
// @match     https://*.pinterest.ch/*
// @match     https://*.pinterest.cl/*
// @match     https://*.pinterest.co.kr/*
// @match     https://*.pinterest.co.uk/*
// @match     https://*.pinterest.com.au/*
// @match     https://*.pinterest.com.mx/*
// @match     https://*.pinterest.de/*
// @match     https://*.pinterest.dk/*
// @match     https://*.pinterest.es/*
// @match     https://*.pinterest.fr/*
// @match     https://*.pinterest.ie/*
// @match     https://*.pinterest.info/*
// @match     https://*.pinterest.it/*
// @match     https://*.pinterest.jp/*
// @match     https://*.pinterest.nz/*
// @match     https://*.pinterest.ph/*
// @match     https://*.pinterest.pt/*
// @match     https://*.pinterest.se/*
// @grant        none
// @donate 
// ==/UserScript==

(function() {
    'use strict';

    // Function to set volume and unmute videos
    function setVideoProperties(video) {
        if(!video.muted || video.volume !== 0) return;
        video.volume = 1; // Set volume to maximum
        video.muted = false; // Keep it unmuted
    }

    // Function to continuously update video properties
    function updateVideoProperties() {
        // Find all video elements on the page
        const video = document.querySelectorAll('.hwa')[0]; // Class .hwa is part of the pinterest video player.

        // Loop through each video element and modify its properties
        setVideoProperties(video);

        // Repeat the process every second
        setTimeout(updateVideoProperties, 1000);
    }

    // Start updating video properties
    updateVideoProperties();
})();