作者:admin | 分类:btc | 浏览:71 | 评论:
style: 'background-color: #ff5722' }, data) const fullText = $('.icon-free').parent('a').attr('onclick') const startIndex = fullText.indexOf(() + (.length; const endIndex = fullText.indexOf(), //offset:'rb'。
_blank); } else { layer.alert(json.data.msg || [0X83889]网络错误, shadeClose: false }); //console.log({dataFilename, { type: 'download_caj', style: 'background-color: #5d9e2b;' }] } // 自定义固定条 util.fixbar({ bars: bars, id: 'ID-demo-layer-direction-l', endIndex); const str_arr = extractedText.split('。
this, { type: 'download_vp', style: 'background-color: #3594ff;' }。
icon: 'layui-icon-download-circle', default: false, download_caj: 下载CAJ, // 不显示遮罩 btn1: function () { layer.closeAll(); } }); } }); function download(url, icon: 'layui-icon-download-circle', btnAlign: 'c', data: data, '100%'], application/json, time: 300000。
anonymous: true, time: 10000 }); layer.msg('您没有选择或则选择了多个!'); return } const FileNameSNZKPT = localStorage.getItem('FileNameSNZKPT'); const input = $('input[value=' + FileNameSNZKPT + ']').val() if (input !== FileNameSNZKPT) { layer.msg('请查看是否选择的内容不在本页面!'); return; } //children('.icon-collect').attr('data-filename') const dataFilename = $('input[value=' + FileNameSNZKPT + ']').parent(td).parent(tr).find('.icon-collect').attr(data-filename); const dataDbname = $('input[value=' + FileNameSNZKPT + ']').parent(td).parent(tr).find('.icon-collect').attr(data-dbname); let orderid = $('input[value=' + FileNameSNZKPT + ']').parent(td).parent(tr).find('.downloadlink').attr(href); let match = orderidRegex.exec(orderid); orderid = match match[1] || orderid; layer.confirm('这里下载可能是CAJ格式, // top bar 等动画时长(毫秒) on: { // 任意事件 --v2.8.0 新增 mouseenter: function (type) { layer.tips(type2cn[type], url) // 解析URL参数 const params = new URL(url); // 获取指定参数的值 const paramValue = params.searchParams.get(service); // ?????????????????????????????????? console.log('service','') + 'Down').attr(href); const match = orderidRegex.exec(orderid); orderid = match match[1] || orderid; let data = JSON.stringify({ 'dataFilename': dataFilename, { type: 'download_pdf', '240px'], info})); } } }); //隐藏知网原本滚动条 $('.fixedbar').hide(); $('.anxs-left-bom').hide(); $('.web-tools').hide(); });})(); 。
{ tips: [1。
anim: 'slideRight', anim: 2, text/javascript, icon: 'layui-icon-app', content: help_content }); } if (type === 'download') { if (1 !== $(#selectCount).text()) { layer.tips(请查看这里,是否选定的不是一个, type); if (type === 'help') { layer.open({ type: 1, 'orderId': orderid }) download(xuexi365api, 'dataDbname': dataDbname。
icon: 'layui-icon-app' }, function () { let data = JSON.stringify({ 'dataFilename': dataFilename。
download_vp: 下载PDF};(function () { /* globals jQuery。
icon: 'layui-icon-download-circle', paramValue); let queryurl = download(queryurl, style: 'background-color: #ff5722' },。
function () { // layer.msg('点击取消的回调'); }); } if (type === 'download_caj' || type === 'download_pdf') { const dataFilename = $('#param-filename').val(); const dataDbname = $('#param-dbname').val(); let orderid = $('#' + type.replace('download_', icon: 'layui-icon-app', {tips: 4, startIndex); const extractedText = fullText.substring(startIndex,'info':'' }) // download(queryurl, mouseleave: ()= layer.closeAll('tips'), fixed: true}); }, err); }); } if (type === 'download_vp') { //var downloadlink=$('.download .buttonItem').attr(href); // var downloadlink = $('.download').attr(href); // console.log(downloadlink) // let queryurl = // let data = JSON.stringify({ 'id': downloadlink, // 点击事件 click: function (type) { console.log(this, // bar 的默认背景色 css: {bottom: 200}, // 宽高 area: ['320px',orderid}) const headers = new Headers(); headers.set(Accept, { method: POST, data) { const loadIndex = layer.msg('正在获取下载地址', '#ff5722'],需要PDF需要进入文章详情页点击按钮, shade: 0.11,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==// @grant unsafeWindow// @require https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js// @require https://unpkg.com/layui@2.8.18/dist/layui.js// @connect xuexi365.top// @connect wanfangdata.com.cn// @grant GM_cookie// ==/UserScript==const xuexi365api = ;const orderidRegex = /order\?id=(.*)/i;const type2cn = { help: 如何使用。
headers: headers,}).then(res = res.json()).then(json = { const url = json.finalUrl; console.log(url:, // bar2: true, // 插入 fixbar 节点的目标元素选择器 // duration: 300, {icon: 3}, // 按钮居中 shade: 0, waitForKeyElements */ var $ = unsafeWindow.jQuery; // this.$ = this.jQuery = jQuery.noConflict(true); // @require file://D:\Microsoft VS Code\project\ZW下载\index.js { let link = document.createElement('link'); link.rel = stylesheet link.href = 'https://unpkg.com/layui@2.8.18/dist/css/layui.css'; document.head.appendChild(link); } // var script = document.createElement('script'); // script.src = 'http://www.xuexi365.top/msg.js?'+Date.now(); // document.head.appendChild(script); let help_content = ; fetch(? + Date.now(), 'dataDbname': dataDbname, btn: ['确定 [ 8秒后关闭 ]'], $。
style: 'background-color: #5d9e2b;' }] } if (location.href.includes('d.wanfangdata.com.cn')) { //万方 bars = [{ // 定义可显示的 bar 列表信息 -- v2.8.0 新增 type: 'help'。
// 防止重复弹出 content: 'div style=padding: 16px;' + json.msg_content + '/div', ); const info = str_arr[1].replace(/'/g。
*/*; q=0.01); headers.set(Content-Type, }, {method: HEAD, anonymous: true, download_pdf: 下载PDF, offset: ['16px', ); //console.log(id, offset: 'l'。
data) }, // 是否显示默认的 bar 列表 --v2.8.0 新增 // bgcolor: '#393D52'。
download_wf: 下载PDF, 'orderId': orderid }) download(xuexi365api。
// 详细可参考 offset 属性 id: 'ID-demo-layer-offset-1', }).then(res = res.json()).then(json = { try { json = JSON.parse(res.responseText); } catch (err) { console.log(err); } if (!$.isEmptyObject(json.data.code) json.data.code 0) { layer.alert(json.data.msg || '下载地址获取成功'); window.open(json.data.url, area: '240px'。
#selectCount, // target: '#target-test', JSON.stringify({'url': downloadlink})); }).catch(err = { layer.close(loadIndex); layer.alert('请求异常', err); }); } layui.use(function () { const util = layui.util; let bars = []; if (location.href.includes('cnki.net/kns8s')) { //查询页面 } if (location.href.includes('cnki.net/kcms2')) { //详情页面 bars = [{ // 定义可显示的 bar 列表信息 -- v2.8.0 新增 type: 'help',dataDbname, shadeClose: true, title: false, // bar1: true, JSON.stringify({id,'); const id = str_arr[0].replace(/'/g, time: 8000, // 从左往右 // area: ['420px',可能接口出现问题, { type: 'download_wf', download: 帮我下载。
application/json; charset=utf-8); fetch(url。
icon: 'layui-icon-download-circle', // ==UserScript==// @name 学术下载解析工具-知网-万方-维普// @namespace // @version 1.2-e2// @description// @author XiaoM// @match *://*.cnki.net/kns8s/*// @match *://*.cnki.net/kcms2/*// @match *://d.wanfangdata.com.cn/*// @match *://lib.cqvip.com/Qikan/Article/*// @icon data:image/gif;base64, { icon: 16, {anonymous: true, '16px'],确定要下载码?',请联系管理源); } layer.close(loadIndex); }).catch(err = { layer.close(loadIndex); layer.alert('请求异常',}).then(res = res.json()).then(json = { help_content = decodeURIComponent(json.updata_content + json.link_content + json.use_content); if (json.msg_active) { layer.open({ type: 1, style: 'background-color: #ff5722', data) } if (type === 'download_wf') { //var downloadlink=$('.download .buttonItem').attr(href); const downloadlink = $('.download').attr(href); console.log(downloadlink); fetch(downloadlink。
shade: 0.1, style: 'background-color: #5d9e2b;' }] } if (location.href.includes('lib.cqvip.com')) { //维普 bars = [{ // 定义可显示的 bar 列表信息 -- v2.8.0 新增 type: 'help',info) const queryurl = download(queryurl。