腳本已歸檔
該腳本已經被作者歸檔,腳本可能失效並且作者不再維護,你無法再進行問題反饋。
// ==UserScript==
// @name 【智狐】全网VIP视频解析无广告播放,支持B站大会员番剧、视频批量下载,全网独创自由选择自动解析接口|短视频无水印下载|淘宝、天猫、京东优惠券查询|更多功能持续更新中
// @namespace http://www.zhihupe.com/
// @version 0.70
// @author zhihu
// @description 【❤️ 视频自动解析,体会拥有VIP的感觉❤️,适配PC+移动 】功能有:1、支持B站大会员番剧,全网独创自由选择自动解析接口;2、爱奇艺、腾讯、优酷、芒果等全网VIP视频免费解析去广告(免跳出观影特方便);3.B站多P下载;抖音、西瓜视频、快手无水印下载;4.淘宝、天猫、京东优惠券查询5.新增喜马拉雅有声书批量下载
// @icon https://www.zhihupe.com/favicon.ico
// @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/crypto-js/4.1.1/crypto-js.min.js
// @require https://lib.baomitu.com/echarts/4.6.0/echarts.min.js
// @match *://laisoyiba.com/*
// @match *://*.youku.com/v_*
// @match *://*.iqiyi.com/v_*
// @match *://*.iqiyi.com/w_*
// @match *://*.iqiyi.com/a_*
// @match *://v.qq.com/x/cover/*
// @match *://v.qq.com/x/page/*
// @match *://v.qq.com/tv/*
// @match *://*.mgtv.com/b/*
// @match *://*.bilibili.com/video/*
// @match *://*.bilibili.com/bangumi/play/*
// @match *://www.le.com/ptv/vplay/*
// @match *://m.v.qq.com/*
// @match *://m.iqiyi.com/v_*
// @match *://m.iqiyi.com/w_*
// @match *://m.iqiyi.com/a_*
// @match *://m.youku.com/alipay_video/*
// @match *://m.youku.com/video/*
// @match *://m.mgtv.com/b/*
// @match *://m.bilibili.com/video/*
// @match *://m.bilibili.com/anime/*
// @match *://m.bilibili.com/bangumi/play/*
// @match *://m.le.com/vplay_*
// @match *://item.taobao.com/*
// @match *://s.taobao.com/*
// @match *://*detail.tmall.com/*
// @match *://*detail.tmall.hk/*
// @match *://list.tmall.com/search_*
// @match *://*item.jd.com/*
// @match *://npcitem.jd.hk/*
// @match *://*.yiyaojd.com/*
// @match *://search.jd.com/Search*
// @match *://www.ximalaya.com/*
// @match *://www.gwdang.com/*
// @match *://*.douyin.com/video/*
// @match *.kuaishou.com/short-video/*
// @match *.kuaishou.com/video/*
// @match *.ixigua.com/*
// @connect tool.zhihupe.com
// @connect 47.99.158.118
// @connect api.bilibili.com
// @connect mobile.ximalaya.com
// @connect v2.api.haodanku.com
// @connect gwdang.com
// @grant GM_xmlhttpRequest
// @grant GM.xmlHttpRequest
// @grant GM_openInTab
// @grant GM_addStyle
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @grant GM_setClipboard
// @grant GM_download
// @grant unsafeWindow
// @run-at document-body
// @license End-User License Agreement
// @antifeature referral-link 【此提示为GreasyFork代码规范要求含有查券功能的脚本必须添加,实际使用无任何强制跳转,代码可查,请知悉】
// ==/UserScript==
(function() {
'use strict';
//最终用户许可协议 End-User License Agreement
// * Copyright (c) 2021-2022 zhihu. All Rights Reserved.
// * Proprietary and Confidential.
// * 该项目介绍、说明书、脚本代码、思路及其他相关
// 内容版权归作者所有,未经作者本人书面授权,禁
// 止任何单位或个人以任何形式、任何手段或通过任
// 何方式(净室工程、手工、图片、电子、机械、磁
// 性、化学、光学、声学或其它方式)抄袭、摘编、
// 编辑、修改、结集、出版、再版、转录、转载、爬
// 虫爬取、重制、仿制、复制、复写、复印、影印、
// 拷贝、刻录、建立镜像、粘贴、张贴、派发、录音、
// 用来创建派生作品、与其它任何资料进行合并、翻
// 译成任何电脑语言或以其他任何方式用于商业或公
// 共目的。
// * 该项目仅仅准许您善意的使用,其他任何行为都是
// 禁止的。
// * zhihu从未授权任何组织或个人使用本项目脚本
// 部分或全部代码创建作品。
var Insidehtml = "";
var Outsidehtml = "";
var selecthtml = "";
var mobhtml = "";
var PlayID = "";
var jiexi;
var playhref = window.location.href;
var host = window.location.host;
var goodid = "";
var hdapikey ="FF9529914C44"
var method, action, qrname, nodeid,videoid;
var UA = navigator.userAgent;
const scriptInfo = GM_info.script;
const author = scriptInfo.author;
const version = scriptInfo.version;
if(host.indexOf('item.') > -1) {
com = "pc";
}else if (host.indexOf('m.') > -1) {
var com = "wap";
}else {
com = "pc";
}
const playList=[
{"id":"9","name":"M3U8.TV","category":1,"url":"https://jx.m3u8.tv/jiexi/?url=", "showType":3},
{"id":"55","name":"纯净/B站","category":1,"url":"https://z1.m1907.cn/?jx=", "showType":3},
{"id":"2","name":"高速接口","category":1,"url":"https://jsap.attakids.com/?url=", "showType":3},
{"id":"3","name":"综合/B站","category":1,"url":"https://vip.parwix.com:4433/player/?url=", "showType":3},
{"id":"4","name":"OK解析","category":1,"url":"https://okjx.cc/?url=", "showType":3},
{"id":"1","name":"618g","category":1,"url":"https://jx.618g.com/?url=", "showType":3},
{"id":"5","name":"夜幕","category":1,"url":"https://www.yemu.xyz/?url=", "showType":3},
{"id":"6","name":"乐多资源","category":1,"url":"https://api.leduotv.com/wp-api/ifr.php?isDp=1&vid=", "showType":3},
{"id":"7","name":"爱豆","category":1,"url":"https://jx.aidouer.net/?url=", "showType":1},
{"id":"8","name":"虾米","category":1,"url":"https://jx.xmflv.com/?url=", "showType":1},
{"id":"10","name":"人人迷","category":1,"url":"https://jx.blbo.cc:4433/?url=", "showType":3},
{"id":"11","name":"全民","category":1,"url":"https://jx.blbo.cc:4433/?url=", "showType":3},
{"id":"12","name":"七哥","category":1,"url":"https://jx.mmkv.cn/tv.php?url=", "showType":3},
{"id":"13","name":"冰豆","category":1,"url":"https://api.qianqi.net/vip/?url=", "showType":3},
{"id":"14","name":"迪奥","category":1,"url":"https://123.1dior.cn/?url=", "showType":1},
{"id":"15","name":"CK","category":1,"url":"https://www.ckplayer.vip/jiexi/?url=", "showType":1},
{"id":"16","name":"游艺","category":1,"url":"https://api.u1o.net/?url=", "showType":1},
{"id":"17","name":"LE","category":1,"url":"https://lecurl.cn/?url=", "showType":1},
{"id":"18","name":"ckmov","category":1,"url":"https://www.ckmov.vip/api.php?url=", "showType":1},
{"id":"19","name":"playerjy/B站","category":1,"url":"https://jx.playerjy.com/?url=", "showType":3},
{"id":"20","name":"ccyjjd","category":1,"url":"https://ckmov.ccyjjd.com/ckmov/?url=", "showType":1},
{"id":"21","name":"爱豆","category":1,"url":"https://jx.aidouer.net/?url=", "showType":1},
{"id":"22","name":"诺诺","category":1,"url":"https://www.ckmov.com/?url=", "showType":1},
{"id":"23","name":"H8","category":1,"url":"https://www.h8jx.com/jiexi.php?url=", "showType":1},
{"id":"24","name":"BL","category":1,"url":"https://vip.bljiex.com/?v=", "showType":1},
{"id":"25","name":"解析la","category":1,"url":"https://api.jiexi.la/?url=", "showType":1},
{"id":"26","name":"MUTV","category":1,"url":"https://jiexi.janan.net/jiexi/?url=", "showType":1},
{"id":"27","name":"MAO","category":1,"url":"https://www.mtosz.com/m3u8.php?url=", "showType":1},
{"id":"28","name":"老板","category":1,"url":"https://vip.laobandq.com/jiexi.php?url=", "showType":1},
{"id":"29","name":"盘古","category":1,"url":"https://www.pangujiexi.cc/jiexi.php?url=", "showType":1},
{"id":"30","name":"盖世","category":1,"url":"https://www.gai4.com/?url=", "showType":1},
{"id":"31","name":"小蒋","category":1,"url":"https://www.kpezp.cn/jlexi.php?url=", "showType":1},
{"id":"32","name":"YiTV","category":1,"url":"https://jiexi.us/?url=", "showType":1},
{"id":"33","name":"星空","category":1,"url":"http://60jx.com/?url=", "showType":1},
{"id":"34","name":"0523","category":1,"url":"https://go.yh0523.cn/y.cy?url=", "showType":1},
{"id":"35","name":"17云","category":1,"url":"https://www.1717yun.com/jx/ty.php?url=", "showType":1},
{"id":"36","name":"4K","category":1,"url":"https://jx.4kdv.com/?url=", "showType":1},
{"id":"37","name":"云析","category":1,"url":"https://jx.yparse.com/index.php?url=", "showType":1},
{"id":"38","name":"8090","category":1,"url":"https://www.8090g.cn/?url=", "showType":1},
{"id":"39","name":"江湖","category":1,"url":"https://api.jhdyw.vip/?url=", "showType":1},
{"id":"40","name":"诺讯","category":1,"url":"https://www.nxflv.com/?url=", "showType":1},
{"id":"41","name":"PM","category":1,"url":"https://www.playm3u8.cn/jiexi.php?url=", "showType":1},
{"id":"42","name":"奇米","category":1,"url":"https://qimihe.com/?url=", "showType":1},
{"id":"43","name":"思云","category":1,"url":"https://jx.ap2p.cn/?url=", "showType":1},
{"id":"44","name":"听乐","category":1,"url":"https://jx.dj6u.com/?url=", "showType":1},
{"id":"45","name":"aijx","category":1,"url":"https://jiexi.t7g.cn/?url=", "showType":1},
{"id":"46","name":"52","category":1,"url":"https://vip.52jiexi.top/?url=", "showType":1},
{"id":"47","name":"黑米","category":1,"url":"https://www.myxin.top/jx/api/?url=", "showType":1},
{"id":"48","name":"豪华啦","category":1,"url":"https://api.lhh.la/vip/?url=", "showType":1},
{"id":"49","name":"凉城","category":1,"url":"https://jx.mw0.cc/?url=", "showType":1},
{"id":"50","name":"33t","category":1,"url":"https://www.33tn.cn/?url=", "showType":1},
{"id":"51","name":"180","category":1,"url":"https://jx.000180.top/jx/?url=", "showType":1},
{"id":"52","name":"无名","category":1,"url":"https://www.administratorw.com/video.php?url=", "showType":1},
{"id":"53","name":"黑云","category":1,"url":"https://jiexi.380k.com/?url=", "showType":1},
{"id":"54","name":"九八","category":1,"url":"https://jx.youyitv.com/?url=", "showType":1},
{"id":"56","name":"综合线路","category":2,"url":"https://laisoyiba.com/mov/s/?sv=3&url=", "showType":1},
{"id":"57","name":"纯净/B站","category":2,"url":"https://z1.m1907.cn/?jx=", "showType":1},
{"id":"58","name":"高速接口","category":2,"url":"https://jsap.attakids.com/?url=", "showType":1},
{"id":"59","name":"综合/B站1","category":2,"url":"https://vip.parwix.com:4433/player/?url=", "showType":1},
{"id":"60","name":"OK解析","category":2,"url":"https://okjx.cc/?url=", "showType":1},
{"id":"61","name":"夜幕","category":2,"url":"https://www.yemu.xyz/?url=", "showType":1},
{"id":"62","name":"虾米","category":2,"url":"https://jx.xmflv.com/?url=", "showType":1},
{"id":"63","name":"全民","category":2,"url":"https://jx.quanmingjiexi.com/?url=", "showType":1},
];
function Toast(msg, duration = 3000) {
var m = document.createElement('div');
m.innerHTML = msg;
m.setAttribute('id','msg');
m.style.cssText = "max-width:60%;min-width: 150px;padding:0 14px;min-height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;";
document.body.appendChild(m);
setTimeout(() => {
var d = 0.5;
m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
m.style.opacity = '0';
setTimeout(() => { document.body.removeChild(document.querySelector("#msg")) }, d * 1000);
}, duration);
}
function GMiosgetValue(name) {
if(UA.indexOf('iPhone') > -1||host.indexOf('m.iqiyi.com') > -1){
var StorageValue = localStorage.getItem(name);
}else{
StorageValue = GM_getValue(name);
}
return StorageValue;
}
function GMiossetValue(name, Value) {
if(UA.indexOf('iPhone') > -1||host.indexOf('m.iqiyi.com') > -1){
localStorage.setItem(name, Value);
}else{
GM_setValue(name, Value);
}
}
function GMsetValue(name, Value) {
localStorage.setItem(name, Value);
}
function GMgetValue(name) {
let StorageValue = localStorage.getItem(name);
return StorageValue;
}
function GMdeleteValue(name) {
localStorage.removeItem(name);
}
function GMaddStyle(css) {
var addStyle = document.createElement('style');
addStyle.textContent = css;
var doc = document.head || document.documentElement;
doc.appendChild(addStyle);
};
function GMaddScript(js) {
let script = document.createElement('script');
script.src = js;
var docu = document.head || document.documentElement;
docu.appendChild(script);
};
function GMaddlink(linkcss) {
let mylink = document.createElement('link');
mylink.href = linkcss;
mylink.rel = 'stylesheet';
var docl = document.head || document.documentElement;
docl.appendChild(mylink);
};
function GMopenInTab(url, open_in_background) {
if (typeof GM_openInTab === "function") {
GM_openInTab(url, open_in_background);
} else {
GM.openInTab(url, open_in_background);
}
};
function Addjs() {
GMaddScript("https://www.layuicdn.com/layui/layui.js");
GMaddlink("https://www.layuicdn.com/layui/css/layui.css");
}
if(GMiosgetValue("isuser") == 1){
switch (host) {
case 'v.qq.com':
PlayID = "#mod_player";
Addjs();
addbtn();
GMsetValue("playwork","1")
console.log('已进入腾讯');
setInterval(function() {
let e = document.querySelector("#mask_layer");
if (e != null) e.parentNode.removeChild(e);
let f = document.querySelector(".mod_vip_popup");
if (f != null) f.parentNode.removeChild(f);
},
100);
break;
case 'v.youku.com':
Addjs();
PlayID = "#player";
addbtn();
console.log('已进入优酷')
break;
case 'www.iqiyi.com':
Addjs();
PlayID = "#flashbox";
addbtn();
GMsetValue("playwork","1")
console.log('已进入爱奇艺')
break;
case 'www.mgtv.com':
Addjs();
PlayID = "#mgtv-player-wrap";
addbtn();
GMsetValue("playwork","1")
console.log('已进入芒果TV')
break;
case 'www.bilibili.com':
Addjs();
PlayID = "#player_module";
if (playhref.indexOf("www.bilibili.com/bangumi/play") != -1) {
addbtn();
GMsetValue("playwork","1")
}
var Bv = null;
var pathname = window.location.pathname;
if (pathname.indexOf("/medialist/play/watchlater/") != -1) {
Bv = pathname.replace("/medialist/play/watchlater/","").replace("/","");
}else{
Bv = pathname.replace("/video/","").replace("/","");
}
console.log(Bv)
if(Bv!=null){
Getaid(Bv);
}
console.log('已进入bilibili')
break;
case 'www.le.com':
Addjs();
PlayID = "#le_playbox";
addbtn();
GMsetValue("playwork","1")
console.log('已进入乐视TV')
break;
case 'laisoyiba.com':
setInterval(function() {
let e = document.querySelector(".jconfirm-scrollpane");
if (e != null) e.parentNode.removeChild(e);
},
100);
break;
case 'm.v.qq.com':
if(playhref.indexOf('/play') > -1){
PlayID = "#player";
addmobbtn();
GMsetValue("playwork","1")
setInterval(function() {
let e = document.querySelector("#vipPosterContent");
if (e != null) e.parentNode.removeChild(e);
let f = document.querySelector(".at-app-banner");
if (f != null) f.parentNode.removeChild(f);
},
100);
console.log('已进入手机腾讯');
}
break;
case 'm.youku.com':
PlayID = "#player";
setInterval(function() {
let e = document.querySelector(".callEnd_box");
if (e != null) e.parentNode.removeChild(e);
},
100);
addmobbtn();
console.log('已进入手机优酷');
break;
case 'm.iqiyi.com':
PlayID = ".m-video-player-wrap";
addmobbtn();
GMsetValue("playwork","1")
console.log('已进入手机爱奇艺');
break;
case 'm.mgtv.com':
PlayID = ".video-area";
setInterval(function() {
let e = document.querySelector(".mg-down-btn");
if (e != null) e.parentNode.removeChild(e);
let f = document.querySelector(".ad-fixed-bar");
if (f != null) f.parentNode.removeChild(f);
},
100);
addmobbtn();
GMsetValue("playwork","1")
console.log('已进入手机芒果TV');
break;
case 'm.bilibili.com':
PlayID = "#bofqi";
if (playhref.indexOf("m.bilibili.com/bangumi/play") != -1) {
addmobbtn();
GMsetValue("playwork","1")
}
console.log('已进入手机bilibili');
break;
case 'm.le.com':
PlayID = "#j-player";
setInterval(function() {
document.querySelector("#j-player").style.display = "block";
let e = document.querySelector("#j-vipLook");
if (e != null) e.parentNode.removeChild(e);
let f = document.querySelector(".daoliu1");
if (f != null) f.parentNode.removeChild(f);
},
100);
addmobbtn();
GMsetValue("playwork","1")
console.log('已进入手机乐视TV');
break;
case 'item.taobao.com':
qrname = "淘宝";
nodeid = "#J_PromoPrice";
goodid = Getgoodid("id");
method = "taobao";
action = "getlink";
Getcoupon(goodid);
History(goodid);
console.log(goodid);
console.log('已进入淘宝');
break;
case 's.taobao.com':
nodeid = "pic-link";
taobaoso();
GMsetValue("playwork","1")
console.log('已进入淘宝搜索');
break;
case 'detail.tmall.com':
qrname = "天猫";
nodeid = "#J_PromoPrice";
goodid = Getgoodid("id");
method = "taobao";
action = "getlink";
Getcoupon(goodid);
History(goodid);
console.log(goodid);
console.log('已进入天猫');
break;
case 'list.tmall.com':
tmallso();
// GMsetValue("playwork","1")
console.log('已进入天猫搜索');
break;
case 'item.yiyaojd.com':
qrname = "京东";
nodeid = "#J-summary-top";
goodid = geturlid(playhref);
method = "jd";
action = "getdetails";
Getcoupon(goodid);
History(goodid);
console.log(goodid) ;
console.log('已进入京东医药');
break;
case 'item.jd.com':
qrname = "京东";
nodeid = "#J-summary-top";
goodid = geturlid(playhref);
method = "jd";
action = "getdetails";
Getcoupon(goodid);
History(goodid);
console.log(goodid);
console.log('已进入京东');
break;
case 'npcitem.jd.hk':
qrname = "京东";
nodeid = "#J-summary-top";
goodid = geturlid(playhref);
method = "jd";
action = "getdetails";
Getcoupon(goodid);
History(goodid);
console.log(goodid);
console.log('已进入京东国际');
break;
case 'search.jd.com':
// jdso();
console.log('已进入京东搜索');
break;
case 'www.douyin.com':
console.log('已进入抖音') ;
nodeid =".xg-right-grid"
videoid = geturlid(playhref);
douyinbtn(videoid);
console.log(geturlid(playhref))
break;
case 'www.kuaishou.com':
console.log('已进入快手') ;
nodeid =".right"
videoid = geturlid(playhref);
kuaishoubtn(videoid);
console.log(geturlid(playhref))
break;
case 'www.ixigua.com':
console.log('已进入西瓜视频') ;
nodeid =".video_action"
videoid = geturlid(playhref);
window.onload=function() {
xiguabtn(videoid);
}
GMsetValue("playwork","1")
console.log(geturlid(playhref))
break;
case 'www.ximalaya.com':
Addjs();
console.log('已进入喜马拉雅') ;
addximalaya();
break;
case 'www.gwdang.com':
if(playhref.indexOf("slider/verify.html?fromUrl")!=-1){
setInterval(function() {
let e = document.querySelector(".header_new1");
if (e != null) e.parentNode.removeChild(e);
let f = document.querySelector(".texts");
if (f != null){
f.innerHTML='<span>为保证您的正常访问,请进行人机验证<span>';
f.setAttribute("style","margin:20px auto;text-align:center");
}
let g = document.querySelector(".slider_tab");
if (g != null){
g.setAttribute("style","background: #fff;color: #000;box-shadow: 0 0 black;");
}
},
100);
}
break;
}
}else{
var Count;
var TipsPromise = new Promise(function(resolve, reject){
Count = setInterval(function() {
var a = document.body;
if(a != null ){
resolve(a);
}
console.log("监听")
},1000);
});
TipsPromise.then(function(msg){
clearInterval(Count);
let userhtml = '';
if(com == "wap"){
var btncss="margin: 0 20px;";
var tybtncss="width: 130px;"
}else{
btncss="margin: 0 90px;";
tybtncss="width: 180px;"
}
userhtml += '<div style="margin-top: 45px;color: #222;font-weight: 700;font-size: 28px;text-align: center;">脚本使用协议</div>'
userhtml += '<div style="width: 100%;height: 220px;margin: 35px auto 40px;overflow-x: hidden;overflow-y: scroll;">'
userhtml +='<p style="margin: 0 50px 5px;color: #777;font-weight: 400;font-size: 13px;line-height: 22px;word-break: break-all;text-align: justify;"> 感谢您对本脚本的信任,为了更好的使用本脚本,在此,我们郑重提醒您:</p>'
userhtml +='<p style="margin: 0 50px 5px;color: #777;font-weight: 400;font-size: 13px;line-height: 22px;word-break: break-all;text-align: justify;">1.有能力的情况,请大家支持正版</p>'
userhtml +='<p style="margin: 0 50px 5px;color: #777;font-weight: 400;font-size: 13px;line-height: 22px;word-break: break-all;text-align: justify;">2.本脚本仅用学习交流,请勿用于非法、商业用途,使用本脚本下载的内容请勿进行复制、传播等侵权行为</p>'
userhtml +='<p style="margin: 0 50px 5px;color: #777;font-weight: 400;font-size: 13px;line-height: 22px;word-break: break-all;text-align: justify;">3.VIP视频解析中所用到的解析接口全部收集自互联网(源码可见),版权问题请联系相关解析接口所有者,脚本不承担相关责任</p>'
userhtml +='<p style="margin: 0 50px 5px;color: #777;font-weight: 400;font-size: 13px;line-height: 22px;word-break: break-all;text-align: justify;">4.视频下载内容均来自平台本身API接口,不存在破解情况,如果侵权请邮件(188872170@qq.com)联系删除。</p>'
userhtml +='<p style="margin: 0 50px 5px;color: #777;font-weight: 400;font-size: 13px;line-height: 22px;word-break: break-all;text-align: justify;">5.点击我同意后,即已代表您已经充分了解相关问题,否则后果自负,特此声明!</p></div>'
userhtml +='<div style="display: flex;'+btncss+'justify-content: space-between;"><button style="width: 100px;height: 45px;border: none;border-radius: 25px;outline: none;color: #fff;background: #ddd;font-weight: 700;font-size: 15px;line-height: 45px;" id="bty">不同意</button> <button style="'+tybtncss+'height: 45px;border: none;border-radius: 25px;outline: none;color: #fff;background: #ffa000;background: -webkit-gradient(linear,left top,right top,from(#ff5f00),to(#ffa000));background: -webkit-linear-gradient(left,#ff5f00,#ffa000);background: -o-linear-gradient(left,#ff5f00 0,#ffa000 100%);background: linear-gradient(90deg,#ff5f00,#ffa000);font-weight: 700;font-size: 15px;line-height: 45px;" id="ty">我同意</button></div>'
console.log(userhtml)
let y = document.createElement('div');
y.setAttribute("id","user");
y.innerHTML = userhtml;
y.setAttribute("style","position: fixed;top: 50%;left: 50%;width: 480px;max-width: 80%;height: 468px;border-radius: 10px;background-image: url(https://static.hitv.com/pc/img/601d3ee.png),url(https://static.hitv.com/pc/img/21b00eb.png);background-position: 0 0,100% 280px;background-repeat: no-repeat;background-color: #fff;-webkit-box-shadow: 0 0 80px rgba(0,0,0,.25);box-shadow: 0 0 80px rgba(0,0,0,.25);opacity: 1;-webkit-transform: translate(-50%,-50%);-ms-transform: translate(-50%,-50%);transform: translate(-50%,-50%);z-index: 99999;");
document.body.appendChild(y);
document.querySelector("#ty").addEventListener('click',function() {
GMiossetValue("isuser","1");
window.location.reload();
})
document.querySelector("#bty").addEventListener('click',function() {
GMiossetValue("isuser","0");
document.body.removeChild(document.querySelector("#user"));
})
console.log(y);
});
}
if (GMgetValue("playwork") == 1) {
setInterval(function() {
var workurl = window.location.href;
if (playhref != workurl) {
console.log('网址改变了');
playhref = workurl;
window.location.reload()
}
},
200);
}
function CheckAutoplay() {
if (GMgetValue("AutoPlay") == 1) {
autoplay();
Toast('2秒后自动解析视频',2000);
}
}
function sleep(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
function Playlist() {
for (let i = 0; i < playList.length; i++) {
if (playList[i].category == 1) {
Insidehtml += "<span class='jiexi inside' id='Inside_" + i + "' title='" + playList[i].name + "' data-index='" + i + "' data-url='" + playList[i].url + "'>" + playList[i].name + "</span>";
selecthtml += "<option value='" +i + "' name='select' data-url='" + playList[i].url + "'>" + playList[i].name + "</option>"
if (playList[i].showType == 3) {
mobhtml += "<span class='mob-jiexi' id='mob_" + i + "' title='" + playList[i].name + "' data-index='" + i + "' data-url='" + playList[i].url + "'>" + playList[i].name + "</span>";
}
} else {
Outsidehtml += "<span class='jiexi outside 'title='" + playList[i].name + "' data-index='" + i + "' data-url='" + playList[i].url + "'>" + playList[i].name + "</span>";
}
}
console.log(mobhtml);
}
async function addmobbtn() {
await sleep(1000);
CheckAutoplay();
Playlist();
var offautohtml = '<span id="off">关闭自动解析</span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAPoUlEQVR4Xu2debSvUxnHP4iSMVPdzGkRFWq1sAqlDMmsiQwVyhSLSqmssNIoscwqlVCazJGhCa2wWhWtiFxjyJSMKcNtffPe7rncc87v9zv72e+79/t9/jzn3c/wffb39w57P8+eC4sRMALjIjCXsTECRmB8BEwQzw4jMAECJoinhxEwQTwHjMBoCPgOMhpuHtUTBEyQniTaYY6GgAkyGm4e1RMETJCeJNphjoaACTIabh7VEwRMkJ4k2mGOhoAJMhpuo45aF1gHWB1YCVgcWARYEHgR8IJG8VPAE8CjwEPAA8B04FrgSuCKUR3wuOEQMEGGw2vQq+cDdgS2ANZuiKC/pZT/NMS5CjgPOA3Q3ywJETBB0oH5LmBvYFVgKSA3tjOAe4HrgeOAH6cLrb+aciexNqSXBQ4BNgNe2rHg7gF+2vh3R8d8K8YdE2S0VH0Q2B9YDZhnNBXZRj0NXAccCXw7m9VKDJkgwyVSpNgHWHG4YZ25+hbgmIYsnXGqy46YIINl51BgN+Dlg13e+avuAr4JHNx5T1t20ASZOAEbACcAq7ScpyjzNwB7Ar+MMlC6XhNk/AyeCWwFzF16kifx/xngHGDbyuMcKTwT5PmwfQj4ErDYSIiWO+gfwIHAN8oNIb3nJsjsmJ4C7NTCGkb6zI6mUWsppwLvH214faNMkGdzqlVurUivWV+KR4roj80OgN6vzJsgsDVwcg8fqSZjjh65dgXOnuzCmv/fd4LsBxw+ZpNgzbkeJTZtmjwAOGqUwTWM6TNBRA6tLlsmR0ALpL0kSV8JYnJMTornXtFLkvSRIHs0i3/DTxGP0KLiiX2CoW8EUX3GuX1KcECsWzb1JwGqu6eyTwQxOdLNv96QpC8EETm0dWRmSWu6qdJPTf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FgHmKyka5zj4NPAaoy8jdgFa/bwR+COhRqlipgSDFgm/Hu4+ACdL9HNnDFhEwQVoE36a7j4AJ0v0c2cMWETBBWgTfpruPgAnS/RzZwxYRMEFaBN+mu4+ACdL9HNnDFhEwQVoE36a7j4AJ0v0c2cMWETBBWgTfpruPwH8BNepT5xvwC+0AAAAASUVORK5CYII=">'
var onautohtml = '<span id="on">开启自动解析</span><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAPoUlEQVR4Xu2debSvUxnHP4iSMVPdzGkRFWq1sAqlDMmsiQwVyhSLSqmssNIoscwqlVCazJGhCa2wWhWtiFxjyJSMKcNtffPe7rncc87v9zv72e+79/t9/jzn3c/wffb39w57P8+eC4sRMALjIjCXsTECRmB8BEwQzw4jMAECJoinhxEwQTwHjMBoCPgOMhpuHtUTBEyQniTaYY6GgAkyGm4e1RMETJCeJNphjoaACTIabh7VEwRMkJ4k2mGOhoAJMhpuo45aF1gHWB1YCVgcWARYEHgR8IJG8VPAE8CjwEPAA8B04FrgSuCKUR3wuOEQMEGGw2vQq+cDdgS2ANZuiKC/pZT/NMS5CjgPOA3Q3ywJETBB0oH5LmBvYFVgKSA3tjOAe4HrgeOAH6cLrb+aciexNqSXBQ4BNgNe2rHg7gF+2vh3R8d8K8YdE2S0VH0Q2B9YDZhnNBXZRj0NXAccCXw7m9VKDJkgwyVSpNgHWHG4YZ25+hbgmIYsnXGqy46YIINl51BgN+Dlg13e+avuAr4JHNx5T1t20ASZOAEbACcAq7ScpyjzNwB7Ar+MMlC6XhNk/AyeCWwFzF16kifx/xngHGDbyuMcKTwT5PmwfQj4ErDYSIiWO+gfwIHAN8oNIb3nJsjsmJ4C7NTCGkb6zI6mUWsppwLvH214faNMkGdzqlVurUivWV+KR4roj80OgN6vzJsgsDVwcg8fqSZjjh65dgXOnuzCmv/fd4LsBxw+ZpNgzbkeJTZtmjwAOGqUwTWM6TNBRA6tLlsmR0ALpL0kSV8JYnJ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X4A3AglMJ2mNbQ+BR4HfAydGVgKkiLIkgY2NWH9a9AbXoNFlSzYYYPSKFWqoeB6hfc1FSKkHGgqxS3vcAKzer8tOARYEFgHmKyka5zj4NPAaoy8jdgFa/bwR+COhRqlipgSDFgm/Hu4+ACdL9HNnDFhEwQVoE36a7j4AJ0v0c2cMWETBBWgTfpruPgAnS/RzZwxYRMEFaBN+mu4+ACdL9HNnDFhEwQVoE36a7j4AJ0v0c2cMWETBBWgTfpruPwH8BNepT5xvwC+0AAAAASUVORK5CYII=">'
var autohtml;
if (GMgetValue("AutoPlay") == 1) {
autohtml = offautohtml
} else {
autohtml = onautohtml
}
var mainhtml = '<div class="mob-main"><div class="shaw"></div><div class="listmian"><div class="listmian-tit"><p>解析接口列表</p><div class="title_right" id="autobtn">' + autohtml + '</div></div><div class="list">' + mobhtml + '</div><p class="tips"><span class="ico">*</span><span>开启自动解析后,最后一次选择的接口即自动解析默认接口</span></p><p class="tips"><span class="ico">*</span><span>本脚本仅学习使用,解析接口收集于网络,版权问题联系接口制作者,请勿相信解析接口显示的任何广告</span></p></div></div>'
var btnhtml = '<div class="elevator"><a class="elevator-msg" id="Showmain"><svg t="1651763850342" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2320" width="200" height="200"><path d="M661.333333 665.6l51.2 12.8 42.666667-72.533333-34.133333-38.4c4.266667-21.333333 4.266667-38.4 4.266666-55.466667s0-34.133333-4.266666-51.2l34.133333-38.4-42.666667-72.533333-51.2 12.8c-25.6-21.333333-55.466667-42.666667-89.6-51.2L554.666667 256h-85.333334l-17.066666 51.2c-34.133333 8.533333-64 25.6-89.6 51.2l-51.2-12.8-42.666667 72.533333 34.133333 38.4c-4.266667 21.333333-4.266667 38.4-4.266666 55.466667s0 34.133333 4.266666 51.2l-34.133333 38.4 42.666667 72.533333 51.2-12.8c25.6 21.333333 55.466667 42.666667 89.6 51.2L469.333333 768h85.333334l17.066666-51.2c34.133333-8.533333 64-25.6 89.6-51.2z m38.4 81.066667c-21.333333 17.066667-51.2 34.133333-76.8 42.666666L597.333333 853.333333h-170.666666l-25.6-64c-29.866667-12.8-55.466667-25.6-76.8-42.666666l-68.266667 12.8-85.333333-149.333334 42.666666-51.2V512c0-17.066667 0-29.866667 4.266667-42.666667l-42.666667-51.2 85.333334-149.333333 68.266666 12.8c21.333333-17.066667 51.2-34.133333 76.8-42.666667L426.666667 170.666667h170.666666l25.6 64c29.866667 12.8 55.466667 25.6 76.8 42.666666l68.266667-12.8 85.333333 149.333334-42.666666 51.2c4.266667 12.8 4.266667 29.866667 4.266666 42.666666s0 29.866667-4.266666 42.666667l42.666666 51.2-85.333333 149.333333-68.266667-4.266666zM512 554.666667c25.6 0 42.666667-17.066667 42.666667-42.666667s-17.066667-42.666667-42.666667-42.666667-42.666667 17.066667-42.666667 42.666667 17.066667 42.666667 42.666667 42.666667z m0 85.333333c-72.533333 0-128-55.466667-128-128s55.466667-128 128-128 128 55.466667 128 128-55.466667 128-128 128z" fill="#ffffff" p-id="2321"></path></svg><span class="">解析设置</span></a><a id="playing" class="elevator-faq" target="_blank"><svg t="1651762741797" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1235" width="200" height="200"><path d="M512 853.333333c-187.733333 0-341.333333-153.6-341.333333-341.333333s153.6-341.333333 341.333333-341.333333 341.333333 153.6 341.333333 341.333333-153.6 341.333333-341.333333 341.333333z m0-85.333333c140.8 0 256-115.2 256-256s-115.2-256-256-256-256 115.2-256 256 115.2 256 256 256z m128-256l-213.333333 128V384l213.333333 128z" fill="#ffffff" p-id="1236"></path></svg><span class="">解析播放</span></a></div>' + mainhtml;
var mb = document.createElement('div');
mb.innerHTML = btnhtml;
document.body.appendChild(mb);
var css = `body, html {
font-family: "PingFang SC","微软雅黑","Microsoft YaHei",Helvetica,"Helvetica Neue",Tahoma,Arial,sans-serif;
}
.elevator {
position: fixed;
padding: 0 10px;
top: 80%;
margin-top: -140px;
right: 10px;
z-index: 899;
background: rgb(64 64 64 / 81%);
box-shadow: 1px 1px 8px 1px rgb(98 99 99 / 34%);
border-radius: 30px;
}
.elevator a {
position: relative;
display: block;
width: 26px;
height: 56px;
font-size: 22px;
line-height: 20px;
color: #b5b9bc;
box-sizing: border-box;
text-align: center;
}
.elevator a+a:after {
position: absolute;
top: 0;
left: 50%;
margin-left: -12px;
content: '';
width: 24px;
border: 1px solid #F3F5F7;
}
.elevator a:hover {
color: #14191e;
}
.elevator .icon {
font-size: 24px;
line-height: 56px;
color: #199b6d;
width: 28px;
height: 28px;
margin: 14px 0;
}
.elevator .icon:hover {
color: #14191e;
}
.elevator a span {
display: none;
padding: 14px 0;
font-size: 12px;
color: #fff;
line-height: 14px;
}
.elevator .elevator-msg:hover .icon,
.elevator .elevator-faq:hover .icon, {
display: none;
}
.elevator .elevator-msg:hover span,
.elevator .elevator-faq:hover span, {
display: inline-block;
}
.mob-main{
display: none;
}
.shaw{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 99998;
background: rgba(0,0,0,0.3);
}
.listmian{
position: fixed;
width:100%;
height:400px;
bottom: 0;
z-index: 99999;
border-radius: 14px 14px 0 0;
background: #fff;
box-shadow: 0 -8px 10px 0 rgba(0,0,0,.09);
}
.listmian-tit{
background-color: #f5f5f5;
height: 60px;
line-height: 60px;
position: relative;
border-radius: 14px 14px 0 0;
}
.listmian-tit p {
color: #222;
font-size: 18px;
font-weight: 600;
margin-left: 20px;
float: left;
}
.listmian-tit .title_right {
float: right;
margin-right: 20px;
}
.listmian-tit .title_right span{
display: inline-block;
color: #222;
font-size: 14px;
vertical-align: middle;
font-weight: 900;
}
.title_right img{
display: inline-block;
width: 12px;
height: 12px;
margin-left: 3px;
vertical-align: middle;
}
.list{
margin: 10px 20px;
display:flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
height: 240px;
overflow-y: scroll;
align-content: flex-start
}
.list span{
display: inline-block;
padding: 10px 5px;
margin: 0 0 10px 0;
background-color: #f6f8fa;
border-radius: .07rem;
min-width: 90px;
text-align: center;
font-size: 12px;
line-height: 18px;
}
.jiexiselect{
color: #ff6022;
}
.tips{
margin: 5px 20px;
}
.tips span{
font-size: 12px;
font-weight: 700;
color: #333;
line-height: 14px;
}
.tips .ico{
margin-right: 5px;
color: #ff6022;
}
`;
GMaddStyle(css);
if (GMgetValue('selectid') != null) {
document.querySelector('#' + GMgetValue('selectid')).classList.add("jiexiselect");
}
document.querySelector('#playing').addEventListener('click',
function() {
autoplay();
Toast('2秒后自动解析视频',2000);
});
document.querySelector('#Showmain').addEventListener('click',function() {
document.querySelector(".mob-main").style.display = "block"
});
document.querySelector('.shaw').addEventListener('click',function() {
document.querySelector(".mob-main").style.display = "none"
})
document.querySelector('#autobtn').addEventListener('click',function() {
if (GMgetValue('AutoPlay') == 1) {
this.innerHTML = onautohtml;
GMsetValue('AutoPlay', '0');
} else {
this.innerHTML = offautohtml;
GMsetValue('AutoPlay', '1');
Toast('请选择自动解析接口',2000);
};
});
var list = document.getElementsByClassName('mob-jiexi');
for (var i in list) {
list[i].addEventListener('click',function() {
Toast('开始解析视频',2000);
if (GMgetValue('selectid') != null) {
document.querySelector('#' + GMgetValue('selectid')).classList.remove("jiexiselect");
}
var playObjecturl = this.getAttribute("data-url");
var playid = this.getAttribute("id");
console.log(playid);
GMsetValue('selectid', playid);
GMsetValue('selecturl', playObjecturl);
this.classList.add("jiexiselect");
document.querySelector(".mob-main").style.display = "none";
let url = playObjecturl + window.location.href;
console.log(url);
GoPlay(url);
})
}
}
async function addbtn() {
await sleep(1000);
CheckAutoplay();
var btnhtml = '<div class="elevator"><a class="elevator-msg" id="PlayMain"><svg t="1651763850342" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2320" width="200" height="200"><path d="M661.333333 665.6l51.2 12.8 42.666667-72.533333-34.133333-38.4c4.266667-21.333333 4.266667-38.4 4.266666-55.466667s0-34.133333-4.266666-51.2l34.133333-38.4-42.666667-72.533333-51.2 12.8c-25.6-21.333333-55.466667-42.666667-89.6-51.2L554.666667 256h-85.333334l-17.066666 51.2c-34.133333 8.533333-64 25.6-89.6 51.2l-51.2-12.8-42.666667 72.533333 34.133333 38.4c-4.266667 21.333333-4.266667 38.4-4.266666 55.466667s0 34.133333 4.266666 51.2l-34.133333 38.4 42.666667 72.533333 51.2-12.8c25.6 21.333333 55.466667 42.666667 89.6 51.2L469.333333 768h85.333334l17.066666-51.2c34.133333-8.533333 64-25.6 89.6-51.2z m38.4 81.066667c-21.333333 17.066667-51.2 34.133333-76.8 42.666666L597.333333 853.333333h-170.666666l-25.6-64c-29.866667-12.8-55.466667-25.6-76.8-42.666666l-68.266667 12.8-85.333333-149.333334 42.666666-51.2V512c0-17.066667 0-29.866667 4.266667-42.666667l-42.666667-51.2 85.333334-149.333333 68.266666 12.8c21.333333-17.066667 51.2-34.133333 76.8-42.666667L426.666667 170.666667h170.666666l25.6 64c29.866667 12.8 55.466667 25.6 76.8 42.666666l68.266667-12.8 85.333333 149.333334-42.666666 51.2c4.266667 12.8 4.266667 29.866667 4.266666 42.666666s0 29.866667-4.266666 42.666667l42.666666 51.2-85.333333 149.333333-68.266667-4.266666zM512 554.666667c25.6 0 42.666667-17.066667 42.666667-42.666667s-17.066667-42.666667-42.666667-42.666667-42.666667 17.066667-42.666667 42.666667 17.066667 42.666667 42.666667 42.666667z m0 85.333333c-72.533333 0-128-55.466667-128-128s55.466667-128 128-128 128 55.466667 128 128-55.466667 128-128 128z" fill="#ffffff" p-id="2321"></path></svg><span class="">解析设置</span></a><a id="playing" class="elevator-faq" target="_blank"><svg t="1651762741797" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1235" width="200" height="200"><path d="M512 853.333333c-187.733333 0-341.333333-153.6-341.333333-341.333333s153.6-341.333333 341.333333-341.333333 341.333333 153.6 341.333333 341.333333-153.6 341.333333-341.333333 341.333333z m0-85.333333c140.8 0 256-115.2 256-256s-115.2-256-256-256-256 115.2-256 256 115.2 256 256 256z m128-256l-213.333333 128V384l213.333333 128z" fill="#ffffff" p-id="1236"></path></svg><span class="">解析播放</span></a></div>';
var b = document.createElement('div');
b.innerHTML = btnhtml;
document.body.appendChild(b);
console.log("加载成功");
var css = `body, html {
font: 14px/1.5 "PingFang SC","微软雅黑","Microsoft YaHei",Helvetica,"Helvetica Neue",Tahoma,Arial,sans-serif;
color: #1c1f21;
height: 100%;
}
.elevator {
position: fixed;
padding: 0 16px;
top: 55%;
margin-top: -140px;
left: 0;
z-index: 9999;
background: rgb(134 134 134 / 40%);
box-shadow: 1px 1px 8px 1px rgb(98 99 99 / 34%);
border-radius: 0 8px 8px 0;
}
.elevator a {
position: relative;
display: block;
width: 26px;
height: 56px;
font-size: 22px;
line-height: 20px;
color: #b5b9bc;
box-sizing: border-box;
text-align: center;
}
.elevator a+a:after {
position: absolute;
top: 0;
left: 50%;
margin-left: -12px;
content: '';
width: 24px;
border: 1px solid #F3F5F7;
}
.elevator a:hover {
color: #14191e;
}
.elevator .icon {
font-size: 24px;
line-height: 56px;
color: #199b6d;
width: 28px;
height: 28px;
margin: 14px 0;
}
.elevator .icon:hover {
color: #14191e;
}
.elevator a span {
display: none;
padding: 14px 0;
font-size: 12px;
color: #fff;
line-height: 14px;
}
.elevator .elevator-msg:hover .icon,
.elevator .elevator-faq:hover .icon, {
display: none;
}
.elevator .elevator-msg:hover span,
.elevator .elevator-faq:hover span, {
display: inline-block;
}
.jiexi{
padding: 5px 10px;
background: #e5e5e5a3;
font-size: 12px;
border-radius: 4px;
margin:0 5px 10px 5px;
color: #505050;
display: inline-block;
width: 70px;
text-align: center;
}
.jiexiselect{
color: #fff;
background: #fc5531;
}
.scan{
width:164px;
display:inline-block;
text-align: center;
}
.scan img{
width: 140px;
margin: 0 5px 10px 5px;
}
.scan h1{
font-size: 18px;
font-weight: bold;
margin: 0px 0 20px 0;
}
.scan p{
margin: 0;
color: #666;
font-size: 14px;
}
.layui-layer-btn0{
border: 1px solid #dedede!important;
background-color: #fff!important;
color: #333!important;
}
.layui-layer-btn1{
border-color: #1E9FFF!important;
background-color: #1E9FFF!important;
color: #fff!important;
}
`;
GMaddStyle(css);
Playlist();
GMdeleteValue('selectid');
document.querySelector('#playing').onclick = function() {
autoplay();
Toast('2秒后自动解析视频',2000);
};
document.querySelector('#PlayMain').onclick = function() {
console.log("点击成功");
jiexi = GMgetValue('AutoPlay') == 1 ? "checked": "";
layer.tab({
area: ['560px', '400px'],
id: "sett2",
btn: ['取消', '保存设置'],
btnAlign: 'c',
tab: [{
title: '内嵌播放',
content: '<div style="margin:20px 30px 0 30px;display:flex"><div style="width:336px;display:inline-block;padding-right: 15px;height: 270px;overflow-y: scroll;" id="jiexilist">' + Insidehtml + '</div><div class="scan" ><img src="http://cdn.wezhicms.com/uploads/allimg/20211215/1-21121500044Q94.jpg"><h1>智狐百宝箱</h1><p>微信扫描上方二维码</p><p>关注我</p><p>从此不迷路</p></div></div>'
},
{
title: '跳转播放',
content: '<div style="margin:20px 30px 0 30px;display:flex"><div style="width:336px;display:inline-block;padding-right: 15px;height: 270px;overflow-y: scroll;" id="jiexilist">' + Outsidehtml + '</div><div class="scan" ><img src="http://cdn.wezhicms.com/uploads/allimg/20211215/1-21121500044Q94.jpg"><h1>智狐百宝箱</h1><p>微信扫描上方二维码</p><p>关注我</p><p>从此不迷路</p></div></div>'
},
{
title: '解析设置',
content: '<script src="https://www.layuicdn.com/layui/layui.js"></script><div style="margin:20px 30px 0 30px;display:flex"><div style="width:356px;display:inline-block;padding-right: 15px;height: 270px;overflow-y: scroll;" id="jiexilist"><form class="layui-form" action=""><div class="layui-form-item"><label class="layui-form-label">自动解析</label><div class="layui-input-block"><input type="checkbox" ' + jiexi + ' name="switch" lay-skin="switch" id="autoplay" lay-text="ON|OFF"></div></div><div class="layui-form-item"><div class="layui-inline"><label class="layui-form-label">解析接口</label><div class="layui-input-inline"><select name="selectjiexi" lay-verify="required" id ="selectjiexi"><option value="">直接选择或搜索选择</option>' + selecthtml + '</select></div></div></div></form></div><div class="scan" style="width:144px;"><img src="http://cdn.wezhicms.com/uploads/allimg/20211215/1-21121500044Q94.jpg"><h1>智狐百宝箱</h1><p>微信扫描上方二维码</p><p>关注我</p><p>从此不迷路</p></div></div>'
}],
btn2: function(index, layero) {
layero.find("option:selected").each(function() {
if (this.getAttribute("name") == "select") {
let selectedid = this.getAttribute("value");
let selecturl = this.getAttribute("data-url");
GMsetValue('selectedid', selectedid);
GMsetValue('selecturl', selecturl);
console.log(GMgetValue('selectedid'));
}
});
layero.find("input").each(function() {
if (this.getAttribute("name") == "switch") {
let onswitch = document.querySelector("#autoplay+div").getAttribute("class");
if (onswitch.indexOf("layui-form-onswitch") != -1) {
GMsetValue('AutoPlay', '1');
autoplay();
Toast('2秒后自动解析视频',2000);
} else {
GMsetValue('AutoPlay', '0');
}
}
});
}
});
if (GMgetValue('selectid') != null) {
document.querySelector('#' + GMgetValue('selectid')).className += " jiexiselect";
}
if (GMgetValue('selectedid') != null) {
document.querySelector('#selectjiexi').value = GMgetValue('selectedid');
}
var inList = document.getElementsByClassName('inside');
for (var i = 0; i < inList.length; i++) {
inList[i].addEventListener('click',
function() {
if (GMgetValue('selectid') != null) {
document.querySelector('#' + GMgetValue('selectid')).classList.remove("jiexiselect");
}
Toast('开始解析视频',2000);
var playObjecturl = this.getAttribute("data-url");
var playid = this.getAttribute("id");
console.log(playid);
GMsetValue('selectid', playid);
console.log(GMgetValue('selectid'));
this.className = "jiexi inside jiexiselect";
document.body.removeChild(document.querySelector(".layui-layer-tab"));
document.body.removeChild(document.querySelector(".layui-layer-shade"));
let url = playObjecturl + window.location.href;
console.log(url);
GoPlay(url);
});
}
var outList = document.getElementsByClassName('outside');
console.log(outList);
for (var u = 0; u < outList.length; u++) {
outList[u].addEventListener('click',
function() {
let playObjecturl = this.getAttribute("data-url");
let Outsideurl = playObjecturl + window.location.href;
document.body.removeChild(document.querySelector(".layui-layer-tab"));
document.body.removeChild(document.querySelector(".layui-layer-shade"));
console.log(Outsideurl);
window.open(Outsideurl);
});
}
}
}
async function autoplay() {
await sleep(1500);
var f = "";
var autoplayurl;
if (GMgetValue('selecturl') != null) {
f = GMgetValue('selecturl');
}
if (f != "") {
autoplayurl = f + window.location.href;
} else {
let defurl = playList[0].url;
console.log(defurl);
autoplayurl = defurl + window.location.href;
}
GoPlay(autoplayurl);
}
function GoPlay(e) {
let playurl = e;
var iframeDivCss = "width:100%;height:100%;"
if (host.indexOf("m.iqiyi.com") != -1) {
iframeDivCss += "position: absolute;top: 0;right: 0;bottom: 0;left: 0;"
}
var videoPlayer = "<div style='" + iframeDivCss + "' id='zhihuplay'><iframe id='iframe-player-99087lkj' src='" + playurl + "' frameborder='0' allowfullscreen='true' width='100%' height='100%'></iframe></div>";
var PlayCount;
var PlayPromise = new Promise(function(resolve, reject){
PlayCount = setInterval(function() {
var a = document.querySelector(PlayID).children;
if(a != null ){
resolve(a);
console.log(a)
}
console.log("监听")
},1000);
});
PlayPromise.then(function(msg){
clearInterval(PlayCount);
document.querySelector(PlayID).innerHTML = "";
document.querySelector(PlayID).innerHTML = videoPlayer;
});
}
function Getgoodid(gid) {
var reg = new RegExp("(^|&)" + gid + "=([^&]*)(&|$)");
var s = window.location.search.substr(1).match(reg);
if (s != null) {
return s[2];
}
return "";
}
function geturlid(url) {
if (url.indexOf("?") != -1) {
url = url.split("?")[0]
}
if (url.indexOf("#") != -1) {
url = url.split("#")[0]
}
var text = url.split("/");
var id = text[text.length - 1];
id = id.replace(".html", "");
return id
}
function Getcoupon(t) {
if (t != "") {
GM_xmlhttpRequest({
method: "GET",
url: "http://tool.zhihupe.com/coupon/getcoupon.php?m=" + method + "&act=" + action + "&goodid=" + t,
headers: {
"Content-Type": "text/html; charset=utf-8"
},
onload: function(res) {
var json = JSON.parse(res.responseText);
var code = json.code;
console.log(json);
if (method == "taobao") {
if (code == "0") {
var longTpwd = json.data.longTpwd
var couponUrl = longTpwd.match(/https:\/\/[\d\w\.\/]+/)[0];
console.log(longTpwd);
console.log(couponUrl);
var couponInfo = json.data.couponInfo;
var couponEndTime = json.data.couponEndTime;
var actualPrice = json.data.actualPrice;
addcoupon(couponUrl, couponInfo, couponEndTime, actualPrice)
}else{
let u="",f="",t="",p="";
addcoupon(u, f, t, p);
}
} else if (method == "jd") {
if (code == "0") {
var couponConditions = json.data[0].couponConditions;
var couponAmount = json.data[0].couponAmount;
var jdcouponInfo;
if (couponConditions != "") {
jdcouponInfo = "满" + couponConditions + "元减" + couponAmount + "元"
} else {
jdcouponInfo = "无门槛减" + couponAmount + "元"
}
var jdcouponEndTime = json.data[0].couponEndTime
var jdactualPrice = json.data[0].actualPrice;
var couponLink = json.data[0].couponLink;
addcoupon(couponLink, jdcouponInfo, jdcouponEndTime, jdactualPrice)
}else{
let u="",f="",t="",p="";
addcoupon(u, f, t, p);
}
}
},
onerror: function(err) {
console.log(err);
}
});
} else {
console.log('商品id为空!');
}
}
function addcoupon(u, f, t, p) {
var imgurl = "http://v.zhihupe.com/enQrcode?url=" + u
var mainhtml,qa,cxalink;
if(qrname =="淘宝"){
qa = "淘宝";
cxalink ='https://gouwu.zhihupe.com/?r=/l&kw='+encodeURI(document.querySelector("#J_Title").children[0].innerText)+'&sort=0';
}else if(qrname =="天猫"){
cxalink ='https://gouwu.zhihupe.com/?r=/l&kw='+encodeURI(document.querySelector(".tb-detail-hd").children[0].innerText)+'&sort=0';
qa = "淘宝";
}else if(qrname =="京东"){
cxalink = 'https://gouwu.zhihupe.com/?r=/l/jdlist&kw='+encodeURI(document.querySelector(".sku-name").innerText)+'&sort=0';
qa = "京东";
}
if (f != "" && u != "") {
mainhtml = '<div style="text-align: center;font-size: 14px;width: 25%;"><img style="width: 100%;height: auto;"src="' + imgurl + '"><p style="font-size: 12px;margin-top: 5px;">手机' + qa + '扫码领取</p></div><div style="width: 72%;"><p style="margin-bottom:10px;font-size: 18px;font-weight: 700;">优惠劵:' + f + '</p><p style="margin-bottom:10px;font-size: 14px;color:#999;">有效期至:' + t + '</p><div style="display: flex;justify-content: space-between;align-items: flex-start;"><div><span style="font-size:14px">劵后价:</span><span style="font-size: 18px;font-weight: 700;color: #F40;">¥</span><span style="font-size: 26px;font-weight: 700;font-family: Tahoma,Arial,Helvetica,sans-serif;color: #F40;">' + p + '</span></div><a href="' + u + '"><span style="padding: 10px 20px;background-color: #df3033;font-size: 18px;color: #fff;font-weight: 700;">领券购买</span></a></div></div>'
} else {
mainhtml = '<div style="font-size: 18px;font-weight: 700;">暂无优惠券</div><a id="cxalink" style="background: #df3033;padding: 10px;color: #fff;font-size: 12px;">查询同款商品优惠</a>'
}
var couponhtml = '<div style="margin-top: 10px;background: #f1f1f100;padding: 15px 25px;display:flex;align-items: center;justify-content: space-between;margin-bottom:5px;font-family: tahoma,arial,Microsoft YaHei,Hiragino Sans GB;">' + mainhtml + '</div>';
let iCount;
let AddBiPromise = new Promise(function(resolve, reject){
iCount = setInterval(function() {
let a =document.querySelector(nodeid);
let c =a.parentNode;
if(c != null ){
resolve(c)
}
console.log("监听")
},1000);
});
AddBiPromise.then(function(c){
clearInterval(iCount);
let b = document.createElement('div');
b.innerHTML = couponhtml;
c.appendChild(b)
document.querySelector("#cxalink").addEventListener('click',function() {
window.open(cxalink);
})
});
}
//淘宝搜索页
function taobaoso(){
let iCount;
let SoPromise = new Promise(function(resolve, reject){
iCount = setInterval(function() {
let a = document.getElementsByClassName(nodeid);
if(a != null ){
resolve(a)
}
console.log("监听")
},1000);
});
SoPromise.then(function(a){
clearInterval(iCount);
console.log(a);
for (var i = 0; i < a.length; i++) {
let nid =a[i].getAttribute("data-nid");
console.log(a[i]);
GM_xmlhttpRequest({
url:"http://v2.api.haodanku.com/item_detail?apikey="+hdapikey+"&itemid="+nid,
method :"GET",
headers: {
"Content-type": "application/json"
},
onload:function(res) {
let obj = JSON.parse(res.responseText);
console.log(obj);
if(obj.code ==1&&obj.data.couponmoney!=0){
let b = document.createElement('div');
b.style="position: absolute;top: 10px;right: 5px;font-size: 14px;font: 12px/1.5 PingFangSC-Regular,Helvetica,Arial,'Microsoft Yahei',sans-serif;";
b.innerHTML = '<span style="background: #F40;padding: 4px;color: #fff;border: 1px solid red;border-radius: 3px 0 0 3px;font-weight: bold;">券</span><span style="border: 1px solid #ff00001f;border-radius: 0 3px 3px 0;padding: 4px;color: #F40;background: #fff;">优惠'+obj.data.couponmoney+'元</span>';
document.querySelector("#J_Itemlist_PLink_"+nid).appendChild(b)
}
},
onerror: function(err) {
console.log(err);
}
});
}
});
}
//天猫搜索页
function tmallso(){
let iCount;
let SoPromise = new Promise(function(resolve, reject){
iCount = setInterval(function() {
let a = document.getElementsByClassName("productImg");
if(a != null ){
resolve(a)
}
console.log("监听")
},1000);
});
SoPromise.then(function(a){
clearInterval(iCount);
console.log(a);
tmalllist(-1,a);
});
}
function tmalllist(i,a){
setTimeout(function(){
if(++i < a.length){
let f =a[i].getAttribute("href");
var m = document.getElementsByClassName("productImg")[i];
let reg = new RegExp("id=([^&]*)(&|$)");
let s = f.match(reg)[1];
let nid =s;
GM_xmlhttpRequest({
url:"http://v2.api.haodanku.com/item_detail?apikey="+hdapikey+"&itemid="+nid,
method :"GET",
headers: {
"Content-type": "application/json"
},
onload:function(res) {
let obj = JSON.parse(res.responseText);
if(obj.code ==1&&obj.data.couponmoney!=0){
let b = document.createElement('div');
b.style="position: absolute;top: 10px;right: 5px;font-size: 14px;font: 12px/1.5 PingFangSC-Regular,Helvetica,Arial,'Microsoft Yahei',sans-serif;";
b.innerHTML = '<span style="background: #F40;padding: 4px;color: #fff;border: 1px solid red;border-radius: 3px 0 0 3px;font-weight: bold;">券</span><span style="border: 1px solid #ff00001f;border-radius: 0 3px 3px 0;padding: 4px;color: #F40;background: #fff;">优惠'+obj.data.couponmoney+'元</span>';
console.log(obj.data.couponmoney);
m.appendChild(b);
}
tmalllist(i,a);
},
onerror: function(err) {
console.log(err);
}
});
}
}, Math.random() * 10);
}
//历史价格
function History(gid){
let HistoryHtml ='<div style="font-family: Helvetica,Hiragino Sans GB,Microsoft Yahei,sans-serif !important;"><div style="font-size: 18px;font-weight: bold;margin: 0px;text-align: center;">商品历史价格对比查询</div><div id="cxbtn" style="height: 40px;line-height: 40px;padding: 0 18px;background-color: #FF5722;color: #fff;white-space: nowrap;text-align: center;font-size: 14px;border: none;border-radius: 2px;cursor: pointer;margin: 20px auto;width: 80px;">点击查询</div><div style="display:none" id="history"><div><div id="historyhead" style="font-size: 14px;text-align: center;margin-top: 10px;"></div></div><div style="height:400px;" id="container"><span style="text-align: center;font-size: 24px;font-weight: bold;margin: 0 auto;display: block;line-height: 400px;">数据查询中,请稍后...</span></div></div>'
var goodurl,Historynode;
if(method == "taobao"){
goodurl ="https://item.taobao.com/item.htm?id=" + gid;
Historynode = "#detail";
}else if(method == "jd"){
goodurl ="https://item.jd.com/"+ gid+".html";
Historynode = ".product-intro"
}
console.log(goodurl)
let iCount;
let AddHiPromise = new Promise(function(resolve, reject){
iCount = setInterval(function() {
let a =document.querySelector(Historynode);
if(a != null ){
resolve(a)
}
console.log("监听")
},1000);
});
AddHiPromise.then(function(a){
clearInterval(iCount);
let b = document.createElement('div');
b.style = "padding:20px;border: 1px solid #eee;margin: 10px auto;position: relative;clear: both;"
b.innerHTML = HistoryHtml;
a.appendChild(b);
document.querySelector("#cxbtn").addEventListener('click',function() {
getHistory();
this.style.display="none";
document.querySelector("#history").style.display="block";
});
});
}
function getHistory(){
const config ={
main: 'https://www.gwdang.com/',
firstQueryPath: 'https://browser.gwdang.com/brwext/dp_query_latest?union=union_gwdang&format=jsonp',
secondQueryPath: 'https://www.gwdang.com/trend/data_www?show_prom=true&v=2&get_coupon=1&dp_id=',
userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36',
analizyPattern: {
regex: /var dp_id = '(?<dpid>.*)';/,
groupName: 'dpid'
}
}
function randomString(e) {
e = e || 32;
var t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz1234567890",
a = t.length,
n = "";
for (let i = 0; i < e; i++) {
n += t.charAt(Math.floor(Math.random() * a));
}
return n
}
let mockCookie = undefined;
const fp = randomString(32);
const dfp = randomString(60);
let HistoryPromise = new Promise(function(resolve, reject){
GM_xmlhttpRequest({
method: "GET",
url: `${config.firstQueryPath}&url=${encodeURIComponent(playhref)}&fp=${fp}&dfp=${dfp}`,
headers: {
'Cookie': (mockCookie = `fp=${fp};dfp=${dfp};`),
'user-agent': config.userAgent,
'authority': new URL(config.main).host
},
onload: function(res) {
resolve(res);
console.log(JSON.parse(res.responseText));
},
onerror: function(err) {
console.log(err);
}
});
});
HistoryPromise.then(function(c){
const {dp} = JSON.parse(c.responseText);
GM_xmlhttpRequest({
method: "GET",
url: `${config.secondQueryPath}${dp['dp_id']}`,
headers: {
'Cookie': mockCookie,
'user-agent': config.userAgent,
'authority': new URL(config.main).host,
'referer': c.finalUrl
},
onload: function(res) {
let cb =JSON.parse(res.responseText);
if(cb.is_ban==1){
document.querySelector("#history").innerHTML='<div style="text-align:center;margin:20px 0;font-size:14px"><span>由于接口短时间查询次数过大,需要进行人机验证</span><div style="height:38px;line-height:38px;padding:0 18px;background-color:#ff5722;color:#fff;white-space:nowrap;text-align:center;font-size:14px;border:none;border-radius:2px;cursor:pointer;margin-left:20px;display:inline-block" id="Captcha">去验证</div></div>';
document.querySelector("#Captcha").addEventListener('click',function() {
location.href = "https://www.gwdang.com/slider/verify.html?fromUrl="+playhref;
});
}else{
let headhtml ='<div> 历史最低:<span style="margin-right: 5px;">'+cb.series[0].min/100+'</span>当前价:<span class="currentprice" style="margin-right: 20px;">'+cb.series[0].current/100+'</span> </div>'
document.querySelector("#historyhead").innerHTML =headhtml;
Showchart(cb);
console.log(cb);
}
},
onerror: function(err) {
console.log(err);
}
});
});
}
function Showchart(obj){
var oldData = obj.series[0].data;
var chartDom = document.getElementById('container');
var myChart = echarts.init(chartDom);
var option;
var data = [];
var currentDay = new Date().setHours(0, 0, 0, 0);
var currentDayDate = new Date(currentDay).getTime();
var minMonth =4,xBlockNum=6;
var xInterval, yInterval, yMin, yMax, xMin, xMax, maxValue, minValue, maxDate, minDate, addDate;
addDate = minMonth * 30 * 24 * 60 * 60 * 1000; //日期不足三个月,补到120天
var arrX = [], arrY = [];
for (var l = 0; l < oldData.length;l++) {
if (oldData[l][1] <= 0) continue;
let y = oldData[l].y/100;
let x = oldData[l].x*1000
arrX.push(x);
arrY.push(y);
data.push([x,y,""]);
}
console.log(data);
if (data.length > 0 && data[data.length - 1][0] < currentDayDate) {
data.push([currentDayDate, data[data.length - 1][1], ""]);
}
maxValue = Math.max.apply(null, arrY); //y轴最大值
minValue = Math.min.apply(null, arrY); //y轴最小值
maxDate = new Date(data[data.length - 1][0]).getTime(); //最大日期
minDate = new Date(data[0][0]).getTime(); //最小日期
yMin = minValue - ((minValue + maxValue) / 2 - minValue); //y轴开始最小值
yMin = yMin >= 0 ? yMin : 0;
yMax = maxValue + (maxValue - minValue) / 4;
if (yMax === yMin) {
yMin = yMin - yMin / 2;
yMax = yMax + yMax / 2;
}
if (maxDate - minDate > addDate) {
xMin = minDate;
} else {
xMin = maxDate - addDate; //往前补四个月
}
xMax = maxDate;
xInterval = (xMax - xMin) / xBlockNum;
yInterval = (yMax - yMin) / xBlockNum;
console.log(arrX );
option = {
animation: false,
tooltip: {
trigger: 'axis',
transitionDuration: 0,
confine: true,
backgroundColor: 'transparent',
padding: 0,
borderWidth: 0,
borderColor: '#ec652e',
position: function (point, params, dom) {
var width = dom.clientWidth;
return [point[0] - width / 2, 0];
},
formatter: function (obj) {
if (obj.length > 0) {
var timeArr = getLocalTime(obj[0].data[0]).split('-');
var time = timeArr[0] + '年' + timeArr[1] + '月' + timeArr[2] + '日';
var minPrice = obj[0].data[1];
var youhui = obj[0].data[2];
for (var i = 1; i < obj.length; i++) {
if (obj[i].data[1] < minPrice) {
minPrice = obj[i].data[1];
youhui = obj[i].data[1];
}
}
var retHTML = '<div style="border-radius:10px;padding:0 10px;height:22px;line-height:22px;background:#ec652e; color:#ffffff; font-size:11px;">' + time + ' ¥' + minPrice + '</div>';
if (youhui.length > 0) {
retHTML = '<div style="border-radius:10px;padding:0 10px;height:44px;line-height:22px;background:#ec652e; color:#ffffff; font-size:11px;">' + time + ' ¥' + minPrice + "<br/>" + youhui + '</div>';
}
var curDate = new Date();
var vDate = new Date(obj[0].data[0]);
if (obj[0].dataIndex === 0 && vDate > new Date(curDate.getTime() - 24 * 60 * 60 * 1000 * 25 * 30)) {
if (youhui.length > 0) {
retHTML = '<div style="border-radius:10px;padding:0 10px;height:22px;line-height:44px;background:#ec652e; color:#ffffff; font-size:11px;">第一次收录 ' + time + ' ¥' + minPrice + "<br/>" + youhui + '</div>';
}
else {
retHTML = '<div style="border-radius:10px;padding:0 10px;height:22px;line-height:22px;background:#ec652e; color:#ffffff; font-size:11px;">第一次收录 ' + time + ' ¥' + minPrice + '</div>';
}
}
return retHTML;
}
},
axisPointer: {
type: 'line',
lineStyle: {
color: '#ec652e'
}
}
},
grid: {
left: "3%",
right: "3%",
bottom: "3%",
top: 20,
containLabel: true
},
xAxis: {
type: 'time',
axisTick: {
show: false
},
axisLine: {
lineStyle: {
color: '#dddddd'
}
},
interval: xInterval,
boundaryGap: false,
align: 'right',
axisLabel: {
align: 'right',
rotate: 0,
color: '#555555',
showMinLabel: true,
showMaxLabel: true,
formatter: function (value, index) {
var date = new Date(value);
//var texts = [(date.getMonth() + 1) > 9 ? (date.getMonth() + 1) : ('0' + (date.getMonth() + 1)), date.getDate() > 9 ? date.getDate() : ('0' + date.getDate())];
var texts = [(date.getMonth() + 1), date.getDate()];
if (index === 0) {
texts = [''];
} else if (index === (arrX.length - 1)) {
//texts.unshift(date.getFullYear());
} else {
//texts = [''];
}
return texts.join('-');
}
},
splitLine: {
show: true,
lineStyle: {
color: ['#ddd'],
type: 'solid',
opacity: .8
}
},
min: function (value) {
return xMin;
},
max: function (value) {
return xMax;
}
},
yAxis: {
type: 'value',
axisTick: {
show: false
},
interval: yInterval,
boundaryGap: false,
scale: true,
axisLabel: {
show: true,
inside: false,
showMinLabel: true,
showMaxLabel: true,
color: '#555',
formatter: function (value, index) {
if (index === 0) {
} else {
return value.toFixed(0);
}
}
},
axisLine: {
lineStyle: {
color: '#dddddd'
}
},
splitLine: {
show: true,
lineStyle: {
color: ['#ddd'],
type: 'solid',
opacity: .8
}
},
//最小刻度
min: function (value) {
return yMin;
},
max: function (value) {
return yMax;
}
},
series: [{
name: '价格',
type: 'line',
symbol: 'circle',
symbolSize: [2, 2],
showSymbol: false,
itemStyle: {
color: '#ff6729'
},
lineStyle: {
width: 2,
shadowColor: '#dddddd',
shadowBlur: 0,
shadowOffsetY: 0.3,
shadowOffsetX: 0,
z: 22
},
markLine: {
silent: true,
symbol: 'none',
data: [{
type: 'max',
symbol: 'none',
lineStyle: {
color: '#888888',
type: 'dotted',
width: 0.8
},
label: {
position: 'end',
formatter: '{c}',
color: 'transparent'
//color: '#555555'
}
}, {
type: 'min',
symbol: 'none',
lineStyle: {
color: '#888888',
type: 'dotted',
width: 0.8
},
label: {
position: 'end',
formatter: '{c}',
color: '#555555'
}
}],
label: {
show: true,
position: 'left'
}
},
data: data
}],
};
if (maxDate - minDate < addDate) {
var lineDash = [{
coord: [xMin, arrY[0]],
lineStyle: {
width: 1.3
}
}, {
coord: [arrX[0], arrY[0]]
}];
option.series[0].markLine.data.push(lineDash)
}
myChart.clear();
myChart.setOption(option, true);
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 1,
dataIndex: 1
})
}
function getLocalTime(nS) {
var year = new Date(parseInt(nS)).getFullYear();
var mouth = new Date(parseInt(nS)).getMonth() + 1;
mouth = mouth < 10 ? '' + mouth : mouth;
var day = new Date(parseInt(nS)).getDate() < 10 ? '' + new Date(parseInt(nS)).getDate() : new Date(parseInt(nS)).getDate();
return year + '-' + mouth + '-' + day;
}
function Getaid(Bv){
console.log(Bv)
let BiliPromise = new Promise(function(resolve, reject){
GM_xmlhttpRequest({
url:"http://api.bilibili.com/x/web-interface/archive/stat?bvid="+Bv,
method :"GET",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj = JSON.parse(res.responseText);
console.log(obj);
if(obj.code ==0){
let aid = obj.data.aid;
resolve(aid);
}
},
onerror: function(err) {
console.log(err);
}
});
});
BiliPromise.then(function (aid){
GM_xmlhttpRequest({
url:"https://api.bilibili.com/x/web-interface/view?aid="+aid,
method :"GET",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj = JSON.parse(res.responseText);
if(obj.code == 0){
let arr = obj.data.pages;
console.log(arr);
var Bilihtml=""
for (var i = 0; i < arr.length; i++) {
Bilihtml += '<li><a href="javascript:void(0)" class="router-link-active" ><div class="clickitem"><div class="link-content"><input data-aid="'+aid+'" data-cid="'+arr[i].cid+'" title="'+arr[i].part+'" type="checkbox" style="margin-right:5px"> <span class="page-num">P'+arr[i].page+'</span><span class="part">'+arr[i].part+'</span></div><div class="duration bilidown" data-aid="'+aid+'" data-cid="'+arr[i].cid+'" title="'+arr[i].part+'">下载</div></div></a></li>';
}
addbililist(Bilihtml);
}else{
Toast("获取下载列表失败");
}
},
onerror: function(err) {
console.log(err);
}
});
})
}
function addbililist(html) {
let downhtml ='<div class="head-con"><div class="head-left"><h3>下载列表</h3></div><div class="head-right"><span class="next-button" id="sanlian"><span class="txt" style="color: #00a1d6;">一键三连</span></span></div></div><div class="cur-list"><ul class="list-box">'+html+'</ul></div><div style="display: flex;justify-content: space-between;height: 42px;line-height: 42px;margin: 0px 15px;font-size: 14px;font-weight: bold;border-top: 1px solid #dadada;"><div><span style="margin-right: 20px;" id="all">全选</span><span id="delall">重置</span></div><div><span style="margin-right: 20px;" id="aria2set">设置</span><a id="pldown"><span>批量下载</span></a></div></div>'
let iCount;
let AddBiPromise = new Promise(function(resolve, reject){
iCount = setInterval(function() {
var a = document.querySelector("#danmukuBox");
if(a != null ){
resolve(a)
}
console.log("监听")
},1000);
});
AddBiPromise.then(function(msg){
clearInterval(iCount);
var b = document.createElement('div');
b.innerHTML = downhtml;
b.setAttribute("id","downBox");
b.setAttribute("class","multi-page report-wrap-module report-scroll-module");
b.style.margin = "0 0 10px 0";
msg.after(b);
bilibilidown();
});
}
function bilibilidown(){
var inu = document.querySelector("#downBox");
var b=inu.getElementsByTagName('input');
aria2set(b);
document.querySelector("#sanlian") .addEventListener('click',function() {
console.log("一键三连");
document.querySelector(".like").click();
document.querySelector(".coin").click();
});
document.querySelector("#pldown") .addEventListener('click',function() {
let passwordCode = GMgetValue("plcode");
if (passwordCode !=""&&passwordCode !=null) {
GM_xmlhttpRequest({
method: "GET",
url: "http://tool.zhihupe.com/bdwpcs.php?m=BILIBILI&author="+author+"&PWD="+passwordCode,
headers: {
"Content-Type": "text/html; charset=utf-8"
},
onload: function(res){
console.log(res.responseText)
var json=JSON.parse(res.responseText);
if(json.error == 1){
let arr =[];
b.forEach(function(element) {
if(element.checked == true){
let aid = element.getAttribute("data-aid");
let cid = element.getAttribute("data-cid");
let title = element.getAttribute("title");
let json ={
"aid": aid,
"cid": cid,
"title": title,
};
arr.push(json);
}
})
if(arr.length == 0){Toast("请选择需要下载的视频",3000)}else{
bipldown(arr);
}
}else if(json.error == -2){
let msg =json.msg
Toast(msg);
}else {
Toast('服务器请求失败,请重试!');
}
},
onerror: function(err){
Toast(err);
}
});
}else {
Toast('请在脚本设置里输入验证码!');
}
});
let biliList = document.getElementsByClassName('bilidown');
console.log(biliList);
for (var i = 0; i < biliList.length; i++) {
biliList[i].addEventListener('click',function() {
let aid = this.getAttribute("data-aid");
let cid = this.getAttribute("data-cid");
let title = this.getAttribute("title");
GM_xmlhttpRequest({
url:"https://api.bilibili.com/x/player/playurl?avid="+aid+"&cid="+cid+"&qn=112",
method :"GET",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj = JSON.parse(res.responseText);
if(obj.code == 0){
window.open(obj.data.durl[0].url);
console.log(obj)
}else{
Toast("获取下载链接失败");
}
},
onerror: function(err) {
console.log(err);
}
});
});
}
}
function bipldown(a){
let pldownarr=[];
for (var i = 0; i < a.length; i++) {
let title =i+1+"."+a[i].title+".flv";
GM_xmlhttpRequest({
url:"https://api.bilibili.com/x/player/playurl?avid="+a[i].aid+"&cid="+a[i].cid+"&qn=112",
method :"GET",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj = JSON.parse(res.responseText);
if(obj.code == 0){
// window.open(obj.data.durl[0].url);
// addUri(obj.data.durl[0].url,title)
let json ={
"url": obj.data.durl[0].url,
"title":title.replace(/\//g, '-'),
};
pldownarr.push(json);
if(pldownarr.length==a.length){
console.log(pldownarr);
plaria2(-1,pldownarr);
}
console.log(obj)
}else{
Toast("获取下载链接失败");
}
},
onerror: function(err) {
console.log(err);
}
});
}
}
function addximalaya(){
if(playhref.indexOf("www.ximalaya.com/album")!= -1){
let a=document.getElementsByClassName("s_O")[1].innerText;
let b=a.replace(/[^0-9]/ig,"")
if(b<=100){
var page = 1
}else{
page =Math.ceil(b/100)
}
let albumId = geturlid(playhref);
let arr =[];
return new Promise(function(resolve, reject){recurTest(0, page,albumId,arr);
function recurTest(j,length,albumId){
setTimeout(function(){
if(++j <= length){
GM_xmlhttpRequest({
url:"https://www.ximalaya.com/revision/album/v1/getTracksList?albumId="+albumId+"&pageSize=100&pageNum="+j+"&sort=0",
method :"GET",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj = JSON.parse(res.responseText);
if(obj.ret == 200){
let tracks =obj.data.tracks;
arr = arr.concat(tracks)
console.log(arr)
recurTest(j, length,albumId,arr);
if(j==length){
resolve(arr)
};
}else{
Toast("获取下载列表失败");
}
},
onerror: function(err) {
console.log(err);
}
});
console.log(j, length,albumId)
}
}, Math.random() * 100);
}
}).then((listarr) => {
let downhtml=""
for (var i = 0; i < listarr.length; i++) {
downhtml += '<li class="_nO"><input data-trackId="'+listarr[i].trackId+'" title="'+listarr[i].title+'" type="checkbox" style="margin-right:5px;"><div class="text _nO" style="max-width: 160px;"><span class="title _nO">'+listarr[i].index+'.'+listarr[i].title+'</span></div><div class="right _nO" style="margin: 0 5px;width: 35px;"><a class="ximadown" data-trackId="'+listarr[i].trackId+'" title="'+listarr[i].title+'" href="javascript:void(0)" ><span class="time _nO">下载</span></a></div></li>';
}
let t =document.getElementsByClassName("xui-card")[0]
let p =t.parentNode;
let list = document.createElement('div');
list.innerHTML ='<div class="xui-card" style="margin-bottom: 15px;"><div class="xui-card-head border"><span class="xui-card-head-title" style="display: block;"><i style="color: #666;" class="xuicon xuicon-quanjubofangqi-xiazai font-icon-18"></i></i>下载列表<div class="xui-card-extra"><a rel="nofollow" class="xui-card-extra-title Tj_" href="javascript:void(0)"><span id="aria2set">设置</span></a></div></span></div><div style="margin: 0;max-height: 300px;overflow-y: scroll;" class="xui-card-body"><div class="sound-list H_g"><ul id="downBox">'+downhtml+'</ul></div></div><div style="display: flex;justify-content: space-between;height: 42px;line-height: 42px;margin: 0px 15px;font-size: 14px;font-weight: bold;"><div><span style="margin-right: 20px;" id="all">全选</span><span id="delall">重置</span></div><div><a id="pldown"><span>批量下载</span></a></div></div></div>';
list.setAttribute("class","xui-card");
list.setAttribute("id","ximadown");
p.insertBefore(list,t);
console.log(p);
ximalayadown();
})
}else{
let list = document.getElementsByClassName('album-cover');
if(list!=null){
for (var i in list) {
list[i].addEventListener('click',function() {
let url =this.getAttribute("href");
const a = document.createElement('a');
document.body.appendChild(a)
a.style.display = 'none'
a.href = url;
a.target="_blank"
a.click();
window.location.reload()
})
}
}
}
}
function ximalayadown(){
var inu = document.querySelector("#downBox");
var b=inu.querySelectorAll('input');
aria2set(b);
document.querySelector("#pldown") .addEventListener('click',function() {
let passwordCode = GMgetValue("plcode");
if (passwordCode !=""&&passwordCode !=null) {
GM_xmlhttpRequest({
method: "GET",
url: "http://tool.zhihupe.com/bdwpcs.php?m=BILIBILI&author="+author+"&PWD="+passwordCode,
headers: {
"Content-Type": "text/html; charset=utf-8"
},
onload: function(res){
console.log(res.responseText)
var json=JSON.parse(res.responseText);
if(json.error == 1){
let arr =[];
b.forEach(function(element) {
if(element.checked == true){
let trackId = element.getAttribute("data-trackId");
let title = element.getAttribute("title");
let json ={
"trackId": trackId,
"title": title,
};
arr.push(json);
}
})
if(arr.length == 0){Toast("请选择需要下载的视频",3000)}else{
console.log(arr)
ximapldown(arr);
}
}else if(json.error == -2){
let msg =json.msg
Toast(msg);
}else {
Toast('服务器请求失败,请重试!');
}
},
onerror: function(err){
Toast(err);
}
});
}else {
Toast('请在脚本设置里输入验证码!');
}
});
let ximaList = document.getElementsByClassName('ximadown');
console.log(ximaList);
for (var i = 0; i < ximaList.length; i++) {
ximaList[i].addEventListener('click',function() {
let trackId = this.getAttribute("data-trackId");
let title = this.getAttribute("title");
GM_xmlhttpRequest({
url:'https://mobile.ximalaya.com/mobile-playpage/track/v3/baseInfo/'+new Date().getTime()+'?device=web&trackId='+trackId,
method :"GET",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj = JSON.parse(res.responseText);
console.log(obj)
if(obj.ret == 0){
let downUrl = obj.trackInfo.playUrlList[1].url;
let str1 = downUrl.replaceAll('-','+');
let str2 = str1.replaceAll('_','/');
let num = str2.length%4;
if(num){
str2 += '===='.substr(num);
}
let url = CryptoJS.AES.decrypt({
ciphertext: CryptoJS.enc.Base64.parse(str2)
}, CryptoJS.enc.Hex.parse("aaad3e4fd540b0f79dca95606e72bf93"), {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
}).toString(CryptoJS.enc.Utf8);
console.log(url);
if(url){
GM_download(url,obj.trackInfo.title+'.mp3');
}else{
Toast('解密地址失败');
}
}else{
Toast("获取下载链接失败");
}
},
onerror: function(err) {
console.log(err);
}
});
});
}
}
function ximapldown(arr){
let pldownarr =[]
for (var i = 0; i < arr.length; i++) {
let title =i+"."+arr[i].title+".mp3";;
GM_xmlhttpRequest({
url:'https://mobile.ximalaya.com/mobile-playpage/track/v3/baseInfo/'+new Date().getTime()+'?device=web&trackId='+arr[i].trackId,
method :"GET",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj = JSON.parse(res.responseText);
console.log(obj)
if(obj.ret == 0){
let downUrl = obj.trackInfo.playUrlList[1].url;
let str1 = downUrl.replaceAll('-','+');
let str2 = str1.replaceAll('_','/');
let num = str2.length%4;
if(num){
str2 += '===='.substr(num);
}
let url = CryptoJS.AES.decrypt({
ciphertext: CryptoJS.enc.Base64.parse(str2)
}, CryptoJS.enc.Hex.parse("aaad3e4fd540b0f79dca95606e72bf93"), {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
}).toString(CryptoJS.enc.Utf8);
console.log(url);
url
if(url){
// addUri(decrypted,title)
let json ={
"url": url,
"title": title,
};
pldownarr.push(json)
if(pldownarr.length==arr.length){
console.log(pldownarr);
plaria2(-1,pldownarr);
}
}else{
Toast('解密地址失败');
}
}else{
Toast("获取下载链接失败");
}
},
onerror: function(err) {
console.log(err);
}
});
}
}
function plaria2(i,arr){
setTimeout(function(){
if(++i < arr.length){
addUri(arr[i].url,arr[i].title)
plaria2(i,arr);
console.log(i,arr.length)
}
}, Math.random() * 1000);
}
function aria2set(b){
let css= `
.layui-form{
display: flex;
margin-top: 20px;
}
.layui-form-label {
box-sizing: content-box;
}
.layui-input-block p{
font-size:12px
}
.layui-form-item{
margin-bottom:5px
}
.layui-input-block{
min-height:auto;
}
.main-left{
width: 347px;
}
.scan{
width:200px;
display:inline-block;
text-align: center;
margin-right: 40px;
}
.scan img{
width: 140px;
margin: 0 5px 10px 5px;
}
.scan h1{
font-size: 18px;
font-weight: bold;
margin: 0px 0 20px 0;
}
.scan p{
margin: 0;
color: #666;
font-size: 14px;
}
.layui-layer-btn0{
border: 1px solid #dedede!important;
background-color: #fff!important;
color: #333!important;
}
.layui-layer-btn1{
border-color: #1E9FFF!important;
background-color: #1E9FFF!important;
color: #fff!important;
}
`;
GMaddStyle(css);
document.querySelector("#aria2set") .addEventListener('click',function() {
let rpc="ws://localhost:6800/jsonrpc";
if(GMgetValue("rpc")!=null){
rpc= GMgetValue("rpc")
}
let token="";
if(GMgetValue("token")!=null){
token= GMgetValue("token")
}
let mulu="D:/";
if(GMgetValue("mulu")!=null&&GMgetValue("mulu")!=""){
mulu= GMgetValue("mulu")
}
let plcode="";
if(GMgetValue("plcode")!=null){
plcode= GMgetValue("plcode")
}
let contenthtml ="";
contenthtml +='<script src="https://www.layuicdn.com/layui/layui.js"></script>'
contenthtml +='<form class="layui-form"><div class="main-left">'
contenthtml +='<div class="layui-form-item"> <label class="layui-form-label">RPC地址</label><div class="layui-input-inline"><input name="rpc" value="'+rpc+'" lay-verify="required" placeholder="" class="layui-input"></div></div>'
contenthtml +='<div class="layui-form-item" style="color: #acaeb5;"><div class="layui-input-block"><p>Aria2配置:ws://localhost:6800/jsonrpc<br>Motrix配置:ws://localhost:16800/jsonrpc</p></div></div>'
contenthtml +='<div class="layui-form-item"> <label class="layui-form-label">token</label><div class="layui-input-inline"><input name="token" value="'+token+'" lay-verify="required" placeholder="" class="layui-input"></div></div>'
contenthtml +='<div class="layui-form-item" style="color: #acaeb5;"><div class="layui-input-block"><p>没有请留空</p></div></div>'
contenthtml +='<div class="layui-form-item"> <label class="layui-form-label">保存地址</label><div class="layui-input-inline"><input name="mulu" value="'+mulu+'" lay-verify="required" placeholder="留空使用默认目录" class="layui-input"></div></div>'
contenthtml +='<div class="layui-form-item" style="color: #acaeb5;"><div class="layui-input-block"><p>留空使用默认目录</p></div></div>'
contenthtml +='<div class="layui-form-item"> <label class="layui-form-label">验证码</label><div class="layui-input-inline"><input name="plcode" value="'+plcode+'" lay-verify="required" placeholder="请输入验证码" class="layui-input"></div></div>'
contenthtml +='<div class="layui-form-item" style="color: #acaeb5;"><div class="layui-input-block"><p>批量下载需要关注公众号</p></div></div>'
contenthtml +='</div><div class="scan"><img src="http://cdn.wezhicms.com/uploads/allimg/20211215/1-21121500044Q94.jpg"><h1>验证码获取</h1>'
contenthtml +='<div style="font-size: 12px;color: #000;margin-left:15px;text-align: left;"><div style="line-height: 3;">1.关注公众号【智狐百宝箱】</div><div style="line-height: 3;">2.回复大写字母‘B’获取验证码</div><div style="line-height: 3;">3.将验证码输入左边输入框中</div></div></div></form>'
layer.open({
type: 1,
area: ['580px', '450px'],
title: "批量下载设置",
shade: 0,
id:"biliset",
btnAlign: 'c',
btn: ['取消', '保存设置'],
content:contenthtml
, btn2: function(index, layero) {
layero.find("input").each(function() {
if (this.getAttribute("name") == "rpc") {
GMsetValue("rpc",this.value);
}
else if (this.getAttribute("name") == "token") {
GMsetValue("token",this.value);
}
else if (this.getAttribute("name") == "mulu") {
GMsetValue("mulu",this.value);
}
else if (this.getAttribute("name") == "plcode") {
if(this.value != ""){
GMsetValue("plcode",this.value);
}else{
GMsetValue("plcode","");
Toast('请在脚本设置里输入验证码!');
}
}
});
}
});
});
document.querySelector("#all") .addEventListener('click',function() {
b.forEach(function(element) {
element.checked = true;
})
Toast("已经全部选择",3000)
});
document.querySelector("#delall") .addEventListener('click',function() {
b.forEach(function(element) {
element.checked = false;
});
Toast("已经全部取消选择",3000)
});
}
function douyinbtn(d) {
let downhtml = '<div class="xgplayer-icon"><div class="xgplayer-setting-label"><span class="xgplayer-setting-title">下载</span></div></div>';
let iCount;
console.log(d);
let DYPromise = new Promise(function(resolve, reject){
iCount = setInterval(function() {
var a = document.querySelector(nodeid);
if(a != null ){
resolve(a)
}
console.log("监听")
},1000);
});
DYPromise.then(function(msg){
clearInterval(iCount);
var b = document.createElement('xg-icon');
b.innerHTML = downhtml;
b.setAttribute("class","xgplayer-autoplay-setting automatic-continuous");
b.setAttribute("id","downvideo");
document.querySelector(nodeid).appendChild(b);
getdouyinvideo(d)
});
}
function getdouyinvideo(d){
document.querySelector('#downvideo').addEventListener('click',function() {
Toast("正在获取视频文件",3000)
if (d != "") {
GM_xmlhttpRequest({
method: "GET",
url: "http://tool.zhihupe.com/douyin/api.php?videoid=" + d,
headers: {
"Content-Type": "text/html; charset=utf-8"
},
onload: function(res) {
var json=JSON.parse(res.responseText);
var filename = d+".mp4";
var url = json.downurl
console.log(json);
if (json.code == 1) {
Toast("视频获取成功",3000)
ToastDwon(url,filename);
}else{
Toast("视频文件获取失败",3000)
}
},
onerror: function(err) {
console.log(err);
}
});
} else {
console.log('视频id为空!');
}
});
}
function kuaishoubtn(d) {
let downhtml = '<div>下载</div>';
let iCount;
let KsPromise = new Promise(function(resolve, reject){
iCount = setInterval(function() {
var a = document.querySelector(nodeid);
if(a != null ){
resolve(a)
}
console.log(a)
},1000);
});
KsPromise.then(function(msg){
clearInterval(iCount);
var b = document.createElement('div');
b.innerHTML = downhtml;
b.setAttribute("class","kwai-player-volume-container player-bar-volume show-volume-slide");
b.setAttribute("data-v-0c78ed39","");
b.setAttribute("data-v-5037d859","");
b.setAttribute("data-v-2475c26c","");
b.setAttribute("data-v-56544f8e","");
b.setAttribute("id","downvideo");
let node = document.querySelector(nodeid)
node.insertBefore(b,node.childNodes[0]);
if(playhref.indexOf("short-video")!=-1){
var e = document.querySelector(".total")
e.style.right ="180px"
var f = document.querySelector(".player-bar-progress")
f.style.width ="calc(100% - 318px)";
}
getksvideo(d)
});
}
function getksvideo(d){
document.querySelector('#downvideo').addEventListener('click',function() {
Toast("正在获取视频文件",1000)
let videonode = document.querySelector("video")
let src =videonode.getAttribute("src")
let pausebtn = document.querySelector(".pause-icon");
if(pausebtn != null){
pausebtn.click();
}
if(src.indexOf("blob:") != -1){
GM_xmlhttpRequest({
url:"https://www.kuaishou.com/graphql",
method :"POST",
data:'{"operationName":"visionVideoDetail","variables":{"photoId":"'+d+'","page":"detail"},"query":"query visionVideoDetail($photoId: String, $type: String, $page: String, $webPageArea: String) {\\n visionVideoDetail(photoId: $photoId, type: $type, page: $page, webPageArea: $webPageArea) {\\n status\\n type\\n author {\\n id\\n name\\n following\\n headerUrl\\n __typename\\n }\\n photo {\\n id\\n duration\\n caption\\n likeCount\\n realLikeCount\\n coverUrl\\n photoUrl\\n liked\\n timestamp\\n expTag\\n llsid\\n viewCount\\n videoRatio\\n stereoType\\n croppedPhotoUrl\\n manifest {\\n mediaType\\n businessType\\n version\\n adaptationSet {\\n id\\n duration\\n representation {\\n id\\n defaultSelect\\n backupUrl\\n codecs\\n url\\n height\\n width\\n avgBitrate\\n maxBitrate\\n m3u8Slice\\n qualityType\\n qualityLabel\\n frameRate\\n featureP2sp\\n hidden\\n disableAdaptive\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n __typename\\n }\\n tags {\\n type\\n name\\n __typename\\n }\\n commentLimit {\\n canAddComment\\n __typename\\n }\\n llsid\\n danmakuSwitch\\n __typename\\n }\\n}\\n"}'
,headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj=JSON.parse(res.responseText)
let src=obj.data.visionVideoDetail.photo.photoUrl;
if(res===null){
console.log('失败的id"',d)
}
Toast("视频获取成功",1000)
ToastDwon(src,d)
},
onerror: function(err) {
console.log(err);
}
});
}else{
Toast("视频获取成功",1000)
ToastDwon(src,d)
}
})
}
function xiguabtn(d) {
let downhtml = '<span><span>下载</span></span>';
let iCount;
console.log(d);
var a = document.querySelector(nodeid);
if(a != null ){
var b = document.createElement('button');
b.innerHTML = downhtml;
b.setAttribute("class","video_action_item video_action_item--report video_action_item--triggerAnyWhere");
b.setAttribute("id","downvideo");
a.appendChild(b);
getxgvideo(d)
}
}
function getxgvideo(d){
if(playhref){
document.querySelector('#downvideo').addEventListener('click',function() {
Toast("正在获取视频文件",1000)
GM_xmlhttpRequest({
url:"http://47.99.158.118/video-crack/v2/parse?content="+window.location.href,
method :"POST",
headers: {
"Content-type": "application/json"
},
onload: function(res) {
let obj=JSON.parse(res.responseText)
if(obj.code == 0){
Toast("视频获取成功",1000)
ToastDwon(obj.data.url,d)
}else {
ToastDwon("此视频不支持解析")
}
},
onerror: function(err) {
console.log(err);
}
});
})
}
}
function ToastDwon(videourl,filename) {
var m = document.createElement('div');
m.innerHTML ='<h3 style="text-align: center;margin: 15px 0;font-size: 18px;font-weight: bold;"> 下载视频 </h3><div style="word-break: break-all;padding: 10px;background: #f1f1f1; font-size: 12px; height: 100px;overflow-y: scroll;box-sizing: border-box;margin-bottom: 10px;border-radius: 5px;"><p>'+videourl+'</p> </div><div style="display: flex;float: right;font-size: 14px;"><div id="close" style="margin-right: 15px;">关闭</div> <div> <a id="videofile">下载</a></div></div><div style="float: left;font-size: 14px;"><div> <a href="'+videourl+'" target="_blank">浏览器打开</a></div></div>';
m.setAttribute('id','dwon');
m.style.cssText = "max-width: 480px;min-width: 150px;padding: 0 25px;height: 200px;color: #323442;line-height: 20px;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999998;background: #f8f9fd;font-size: 16px;";
document.body.appendChild(m);
document.querySelector("#close").addEventListener('click',function() {
document.body.removeChild(document.querySelector("#dwon"))
})
document.querySelector("#videofile").addEventListener('click',function() {
Toast("创建下载需要时间,长时间未创建,点击浏览器打开,右键另存为",4000)
// GM_download({
// url:videourl+'.mp4',
// name: filename,
// saveAs: true, //布尔值,显示"保存为"对话框
// onerror: function (error) {
// Toast("下载出错,点击浏览器打开手动保存",3000)
// },
// onprogress: (pro) => {
// },
// ontimeout: () => {
// //如果此下载由于超时而失败,则要执行的回调
// Toast("下载超时,点击浏览器打开手动保存",3000)
// },
// onload: () => {
// Toast("下载完成",3000)
// }
// })
fetch(videourl+'.mp4').then(res => res.blob()).then(blob => {
const a = document.createElement('a');
document.body.appendChild(a)
a.style.display = 'none'
const url = window.URL.createObjectURL(blob);
a.href = url;
a.download = filename;
a.click();
document.body.removeChild(a)
window.URL.revokeObjectURL(url);
});
})
}
function addUri(u,t) {
//配置
return new Promise(function(resolve, reject) {
var wsurl = GMgetValue("rpc");;
var uris = [u];
var token="";
var filename = t
if(GMgetValue("mulu")!=null&&GMgetValue("mulu")!=""){
var mulu= GMgetValue("mulu")
}else{
mulu ="D:/"
}
var options = {
"dir":mulu,
"max-connection-per-server": "16",
"header": [ "User-Agent: "+UA, "Referer: "+playhref ]
};
if (filename != "") {
options.out = filename;
}
var json = {
"id": "zhihu",
"jsonrpc": '2.0',
"method": 'aria2.addUri',
"params": [uris, options],
};
console.log(json)
if (token != "") {
json.params.unshift("token:" + token); // 坑死了,必须要加在第一个
}
var ws = new WebSocket(wsurl);
ws.onerror = event => {
console.log(event);
Toast('连接错误, Aria2 连接错误,请检查RPC设置!');
};
ws.onopen = () => { ws.send(JSON.stringify(json)); }
ws.onmessage = event => {
let received_msg = JSON.parse(event.data);
console.log(received_msg);
if (received_msg.error !== undefined) {
if (received_msg.error.code === 1)Toast('通过RPC连接失败', '请打开控制台查看详细错误信息,返回信息:' + received_msg.error.message);
}
resolve();
switch (received_msg.method) {
case "aria2.onDownloadStart":
Toast("Aria2 发送成功, "+filename+" 已经开始下载!",1000);
ws.close();
break;
default:
break;
}
// version = received_msg.result.version;
};
});
}
// Your code here...
})();