// ==UserScript== // @name ddys-player-history(低端影视-显示播放历史记录) // @version 0.6 // @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 w1529084525@gamil.com // @grant none // @downloadURL https://update.greasyfork.icu/scripts/479222/ddys-player-history%EF%BC%88%E4%BD%8E%E7%AB%AF%E5%BD%B1%E8%A7%86-%E6%98%BE%E7%A4%BA%E6%92%AD%E6%94%BE%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95%EF%BC%89.user.js // @updateURL https://update.greasyfork.icu/scripts/479222/ddys-player-history%EF%BC%88%E4%BD%8E%E7%AB%AF%E5%BD%B1%E8%A7%86-%E6%98%BE%E7%A4%BA%E6%92%AD%E6%94%BE%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95%EF%BC%89.meta.js // ==/UserScript== (function() { 'use strict'; if (localStorage) { // 用于存储记录 let history = [] let k = 'videojs-resume:' let c_k = 'ddys-cn-title:' const origin = window.location.origin; Object.keys(localStorage) .filter(key => key.indexOf(k) != -1) .forEach(key => { history.push(key.replace(k, '')) }) // 排序 history = history.sort() // 分组 let groupedTitles = {}; for (let url of history) { let groupName = url.split('/')[1]; if (!groupedTitles.hasOwnProperty(groupName)) { groupedTitles[groupName] = []; } groupedTitles[groupName].push(url); } // 自动保存中文名称(是否包含视频播放器,判断是否在播放界面) let v = document.getElementsByClassName('wp-playlist') if (v && v.length) { let title = document.title if (title.includes('- 低端影视')) { title = title.split(' - ')[0] if (title.includes('(') && title.includes(')')) { title = title.split(' (')[0] } // 进行保存 localStorage.setItem(c_k + window.location.pathname.split('/')[1], title) } } // 匹配影视中文 /** Object.keys(groupedTitles).forEach(key => { if (!localStorage.getItem(c_k + key)) { $.ajax({ type: "get", url: origin + "/" + key, success: function(response) { if (response.status == 200) { let html = response.responseText let titleRegex = /