Pixiv:修订间差异

添加1,219字节 、​ 2023年9月23日 (星期六)
无编辑摘要
无编辑摘要
标签由可视化切换到源代码编辑
无编辑摘要
第93行: 第93行:
</pre>
</pre>
}}
}}
注:CFW免费额度每日限制Bundled请求数
*使用Nginx(不推荐)
*使用Nginx(不推荐)
{{hide|nginx.htaccess|
{{hide|nginx.htaccess|
第121行: 第122行:
  }
  }
}
}
</pre>
}}
*使用Tampermonkey将P站主站内所有图片链接替换为反代节点(需要前两步任意一步支持)
{{hide|example.js|
<pre>
// ==UserScript==
// @name     Pixiv反代链接替换
// @namespace   https://example.com
// @version    1.0
// @description  Replace i.pximg.net
// @author    USERNAME
// @match     *://www.pixiv.net/*
// @grant     none
// ==/UserScript==
(function() {
   'use strict';
   function replacePximgLinks() {
     const links = document.querySelectorAll('a[href*="i.pximg.net"]');
     const images = document.querySelectorAll('img[src*="i.pximg.net"]');
     links.forEach(link => {
       link.href = link.href.replace(/i\.pximg\.net/g, '#替换为你的节点域名/IP#');
     });
     images.forEach(image => {
       image.src = image.src.replace(/i\.pximg\.net/g, '#替换为你的节点域名/IP#');
     });
   }
   replacePximgLinks();
   // Listen for changes in the DOM, in case the page uses AJAX to load content
   const observer = new MutationObserver(replacePximgLinks);
   observer.observe(document.body, { subtree: true, childList: true });
})();
</pre>
</pre>
}}
}}
27

个编辑