Greasy Fork

Greasy Fork is available in English.

Chzzk_Clips: Unblock & Unmute

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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();
    });
  }

})();