pixiv默認禁止直接訪問圖片,所以被禁止訪問時,先跳轉到圖片所在網址,再跳回來。
当前为
// ==UserScript==
// @name pixiv 解決圖片403禁止訪問
// @namespace https://greasyfork.org/scripts/439130
// @version 1.1
// @description pixiv默認禁止直接訪問圖片,所以被禁止訪問時,先跳轉到圖片所在網址,再跳回來。
// @author fmnijk
// @match https://i.pximg.net/*
// @match https://img-comic.pximg.net/*
// @match http://i.pximg.net/*
// @match http://img-comic.pximg.net/*
// @icon https://www.google.com/s2/favicons?domain=pixiv.net
// @license MIT
// ==/UserScript==
(function() {
'use strict'
if (location.protocol !== 'https:') {
location.replace(`https:${location.href.substring(location.protocol.length)}`);
}
if (document.title === '403 Forbidden') {
const url = window.location.href;
const fname = location.pathname.split('/').slice(-1)[0]
const nurl = `https://www.pixiv.net/member_illust.php?mode=medium&illust_id=${
/(\d+)/.exec(fname)[1]
}`
window.location.replace(nurl);
window.location.replace(url);
}
})();