// ==UserScript== // @id BilibiliWatchlaterRedirect@Laster2800 // @name B站“稍后再看”重定向 // @version 1.3 // @namespace laster2800 // @author Laster2800 // @description B站“稍后再看”播放页重定向至常规播放页面 // @include *://www.bilibili.com/medialist/play/watchlater/* // @grant GM_xmlhttpRequest // @connect api.bilibili.com // @run-at document-start // @downloadURL none // ==/UserScript== (function() { GM_xmlhttpRequest({ method: 'GET', url: `https://api.bilibili.com/x/v2/history/toview/web?jsonp=jsonp`, onload: function(response) { if (response && response.responseText) { try { var part = parseInt(location.href.match(/(?<=\/watchlater\/p)\d+(?=\/?)/)[0]) var json = JSON.parse(response.responseText) var watchList = json.data.list location.replace('https://www.bilibili.com/video/' + watchList[part - 1].bvid) } catch(e) { console.error('重定向错误,请联系脚本作者( https://greasyfork.org/zh-CN/scripts/383441/feedback ):\n' + e) } } } }) })()