Chzzk_Clips: Unblock & Unmute

차단한 유저의 클립 우회 시청 및 음소거 해제

安裝腳本?
作者推薦腳本

您可能也會喜歡 Chzzk_Utils: Chatting Plus Simple Edition

安裝腳本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Chzzk_Clips: Unblock & Unmute
// @namespace    Chzzk_Clips: Unblock & Unmute
// @version      1.1.4
// @description:ko  차단한 유저의 클립 우회 재생(차단한 스트리머X) / 자동 음소거 해제
// @description:en  Blocked clips bypass & auto unmute clips
// @author       DOGJIP
// @match        https://chzzk.naver.com/*
// @match        https://*.chzzk.naver.com/*
// @match        https://m.naver.com/shorts/*
// @run-at       document-start
// @grant        none
// @require      https://unpkg.com/xhook@latest/dist/xhook.min.js
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=chzzk.naver.com
// @description 차단한 유저의 클립 우회 시청 및 음소거 해제
// ==/UserScript==

(function() {
  'use strict';

  const host = location.host;

  // 1) chzzk.naver.com 에서 Clips API 차단 해제
  if (host.endsWith('chzzk.naver.com')) {
    xhook.after((request, response) => {
      const url = request.url;

      // 목록 API (/clips?filterType=ALL)
      if (url.includes('/clips?') && url.includes('filterType=ALL')) {
          //console.log('[xhook] 목록 API 응답 감지:', url);
        try {
          const json = JSON.parse(response.text);
          if (json.content && Array.isArray(json.content.data)) {
            json.content.data.forEach(clip => {
              if (clip.privateUserBlock === true || clip.blindType != null) {
                clip.privateUserBlock = false;
                clip.blindType = null;
              }
            });
            response.text = JSON.stringify(json);
          }
        } catch (e) { /* silent */ }
      }

      // 상세 API (/clips/{id}/detail?optionalProperties=...)
      if (url.match(/\/clips\/[^/]+\/detail\?optionalProperties=/)) {
          //console.log('[xhook] 상세 API 응답 감지:', url);
        try {
          const json = JSON.parse(response.text);
          const op = json.content && json.content.optionalProperty;
          if (op) {
            op.privateUserBlock = false;
            op.blindType = null;
            response.text = JSON.stringify(json);
          }
        } catch (e) { /* silent */ }
      }
    });

    return;
  }

  // 2) m.naver.com/shorts 에서 자동 언뮤트
  if (host === 'm.naver.com') {
    const tryClickUnmute = () => {
      const btn = document.querySelector('button.si_btn_sound');
      if (btn && btn.getAttribute('aria-pressed') === 'true') {
        btn.click();
        return true;
      }
      return false;
    };

    const loop = () => {
      if (!tryClickUnmute()) requestAnimationFrame(loop);
    };

    document.addEventListener('DOMContentLoaded', () => {
      loop();
    });
  }

})();