快速定位至未播放完的视频,用于了解当前有哪些剧集没看完的,避免找不到播放记录。
目前為
// ==UserScript== // @name ddys-player-history(低端影视-显示播放历史记录) // @version 0.5 // @namespace XZX // @license MIT // @description 快速定位至未播放完的视频,用于了解当前有哪些剧集没看完的,避免找不到播放记录。 // @author XZX // @match https://ddrk.me/* // @match https://ddys.tv/* // @match https://ddys.pro/* // @match https://ddys2.me/* // @match https://ddys.art/* // @match https://ddys.mov/* // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com // @supportURL [email protected] // @grant none // ==/UserScript== (function() { 'use strict'; if (localStorage) { // 用于存储记录 let history = [] let k = 'videojs-resume:' const origin = window.location.origin; Object.keys(localStorage) .filter(key => key.indexOf(k) != -1) .forEach(key => { history.push(key.replace(k, '')) }) // 排序+分组 history = history.sort() // 绘制UI const panel = `<div id="play-history" style="border: 1px solid grey; background-color: #1f1f1f; min-width: 220px; position: fixed; right: 0; bottom: 0; border-radius: 10px;color: #367d9d;"> <div style="border-bottom: 1px solid grey; padding: 10px; font-weight: bold; text-align: center;"> <a href="#" style="position: absolute; left: 5px;" onclick="localStorage.clear()">[清空]</a> 播放记录 <a href="#" style="position: absolute; right: 5px;" onclick="document.querySelector('#play-history').remove()">[关闭]</a> </div> <ul style="list-style-type: none; padding: 10px; margin: 0;"> ${!history.length ? '暂无播放记录,先去观影吧...' : history.map(item => ` <li> <a href="${origin + item}">${item}</a> <span style="font-size: 14px">[${((Number(localStorage.getItem(k + item)) / 60).toFixed(2) + '').replace('.', ':')}]</span> <a href="#" style="float:right;margin-left:10px" onclick="localStorage.removeItem('${k + item}');this.parentElement.remove()"><i class="fa fa-remove"></i></a> </li>`) .join('')} <ul> </div> </div>` document.querySelector("body").insertAdjacentHTML("beforeend", panel); // 删除广告 setTimeout(() => { if(document.querySelector('.cfa_popup')){ document.querySelector('.cfa_popup').remove() } }, 1000); } })();