// ==UserScript== // @name 低端影视解析 // @namespace http://tampermonkey.net/ // @version 0.2 // @description 解析低端影视to=>m3u8 // @author Lonelam // @match https://ddrk.me/* // @match https://ddys.tv/* // @grant none // @downloadURL none // ==/UserScript== window._fetch = fetch; window.fetch = (src) => { function download(filename, text) { var element = document.createElement('a'); element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); } let p = window._fetch(src); if (src.includes && src.includes('9543/video?id=')) { p.then((resp)=> { var movie_name = /^https?:\/\/ddrk.(me|tv)\/(.*)\//.exec(location.href)[2] || 'unknown-movie'; let ep_name = new URL(location.href).searchParams.get('ep') || '0'; var file_name = prompt("请输入视频标题,不需要下载m3u8请点取消",movie_name+'-'+ep_name); if (file_name) { resp.json().then((data) => { let pint = pako.ungzip(data.pin,{to:'string'}); if (file_name) { download(file_name +".m3u8", pint); } }) } }); } return p; }