Chzzk_Clips: Unblock & Unmute

Blocked clips bypass & auto unmute clips

// ==UserScript==
// @name         Chzzk_Clips: Unblock & Unmute
// @namespace    Chzzk_Clips: Unblock & Unmute
// @version      1.1.2
// @description:ko  차단한 유저의 클립 우회 시청 및 음소거 해제
// @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')) {
        try {
          const json = JSON.parse(response.text);
          if (json.content && Array.isArray(json.content.data)) {
            json.content.data.forEach(clip => {
              clip.privateUserBlock = false;
              if (clip.blindType) clip.blindType = null;
            });
            response.text = JSON.stringify(json);
          }
        } catch (e) { /* silent */ }
      }

      // 상세 API (/clips/{id}/detail?optionalProperties=...)
      if (url.match(/\/clips\/[^/]+\/detail\?optionalProperties=/)) {
        try {
          const json = JSON.parse(response.text);
          const op = json.content && json.content.optionalProperty;
          if (op) {
            op.privateUserBlock = false;
            if (op.blindType) 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);
    };

    // DOMContentLoaded 이전에도 동작하도록 즉시 호출
    document.addEventListener('DOMContentLoaded', () => {
      loop();
    });
  }

})();