自动点击下载,下载蓝奏云会员apk文件,记住蓝奏云分享密码自动填写
当前为
// ==UserScript==
// @name 蓝奏云自动点击下载,下载会员apk文件,记住分享密码自动填写
// @version 3.0
// @description 自动点击下载,下载蓝奏云会员apk文件,记住蓝奏云分享密码自动填写
// @author ChatGPT
// @include *.lanosso.com/*
// @include *.lanzn.com/*
// @include *.lanzog.com/*
// @include *.lanpw.com/*
// @include *.lanpv.com/*
// @include *.lanzv.com/*
// @include *://*.lanz*.com/*
// @include *://lanz*.com/*
// @run-at document-end
// @grant none
// @namespace https://gf.qytechs.cn/users/452911
// ==/UserScript==
//自动下载
// 找到符合选择器的元素
const element = document.querySelector("[href='javascript:filego();']");
// 如果找到了元素,则触发 click 事件
if (element) {
element.click();
} else {
console.log('未找到符合选择器的元素');
}
// 选择要监视的目标元素
const targetNode = document.body;
// 配置观察器的选项(监视子节点变动)
const config = { childList: true, subtree: true };
// 创建一个观察器实例并指定回调函数
const observer = new MutationObserver(function(mutationsList) {
for(const mutation of mutationsList) {
if (mutation.type === 'childList') {
mutation.addedNodes.forEach(node => {
if (node.tagName && node.tagName.toLowerCase() === 'a') {
// 查找具有 onclick='m_load();' 属性的父元素,并在该父元素中查找子元素 <a> 进行点击
document.querySelector("[onclick='m_load();'] > a").click();
}
});
}
}
});
// 通过观察器实例与目标节点绑定
observer.observe(targetNode, config);
function extractAndNavigateURL() {
// 获取整个页面的 HTML 源码,包括 script 标签中的内容
var htmlSource = document.documentElement.innerHTML;
// 使用正则表达式匹配并提取 vkjxld 和 hyggid 变量的值
var vkjxldMatch = htmlSource.match(/var vkjxld\s*=\s*['"]([^'"]+)['"];/);
var hyggidMatch = htmlSource.match(/var hyggid\s*=\s*['"]([^'"]+)['"];/);
// 确保匹配并提取成功
if (vkjxldMatch && hyggidMatch) {
// 分别获取匹配到的值
var vkjxldValue = vkjxldMatch[1];
var hyggidValue = hyggidMatch[1];
// 拼接得到完整 URL
var completeURL = vkjxldValue + hyggidValue;
// 在当前标签页打开拼接好的 URL
window.location.href = completeURL;
} else {
// 如果没有匹配到,抛出错误提示
console.error('未能找到 vkjxld 或 hyggid 变量');
}
}
extractAndNavigateURL();
(function() {
// 获取整个页面的 HTML 源码,包括 script 标签中的内容
var htmlSource = document.documentElement.innerHTML;
// 使用正则表达式匹配并提取 link 变量的值
var linkMatch = htmlSource.match(/var link\s*=\s*['"]([^'"]+)['"];/);
if (linkMatch) {
// 获取当前页面的域名,包括协议部分
var currentDomain = window.location.origin;
// 获取匹配到的 link 变量的值
var linkValue = linkMatch[1];
// 拼接当前域名和 link 变量的值
var completeURL = currentDomain + '/' + linkValue;
// 在当前标签页打开拼接好的 URL
window.location.href = completeURL;
} else {
// 如果没有匹配到 link 变量,抛出一个错误提示
console.error('未能找到变量 link');
}
})();
//下载apk文件
// 检查是否包含指定文本
function checkTextAndRedirect() {
// 待检查的文本
var textToCheck = "非会员不在支持手机分享此文件,请先开通会员";
// 用于检查页面中是否存在指定文字的代码
var bodyText = document.body.innerText || document.body.textContent;
var textFound = bodyText.indexOf(textToCheck) > -1;
// 如果找到文本,则替换网址
if (textFound) {
var currentUrl = window.location.href;
var newUrl = currentUrl.replace(".com/", ".com/tp/");
// 重新加载替换后的网址
window.location.href = newUrl;
}
}
// 调用函数进行检查和重定向
checkTextAndRedirect();
//记住密码
(function() {
'use strict';
function init() {
retrieveAndFill();
monitorChanges();
}
function retrieveAndFill() {
document.querySelectorAll('input[type="text"], textarea').forEach(function(element) {
const id = getElementIdentifier(element);
const storedValue = localStorage.getItem(id);
if (storedValue) {
element.value = storedValue;
}
});
}
function monitorChanges() {
document.querySelectorAll('input[type="text"], textarea').forEach(function(element) {
element.removeEventListener('input', handleInputChange); // 防止重复监听
element.addEventListener('input', handleInputChange);
});
}
function handleInputChange(event) {
const element = event.target;
const id = getElementIdentifier(element);
localStorage.setItem(id, element.value);
}
function getElementIdentifier(element) {
// 使用页面URL、元素的name、id或类名的组合作为唯一标识符
let identifier = window.location.hostname + window.location.pathname;
identifier += ':' + (element.name || element.id || element.classList[0] || getXPathForElement(element));
return identifier;
}
function getXPathForElement(element) {
const paths = [];
for (; element && element.nodeType === Node.ELEMENT_NODE; element = element.parentNode) {
let index = 0;
let hasFollowingSiblings = false;
for (let sibling = element.previousSibling; sibling; sibling = sibling.previousSibling) {
if (sibling.nodeType === Node.DOCUMENT_TYPE_NODE) continue;
if (sibling.nodeName === element.nodeName) ++index;
}
for (let sibling = element.nextSibling; sibling && !hasFollowingSiblings; sibling = sibling.nextSibling) {
if (sibling.nodeName === element.nodeName) hasFollowingSiblings = true;
}
const tagName = element.nodeName.toLowerCase();
const pathIndex = (index || hasFollowingSiblings ? "[" + (index + 1) + "]" : "");
paths.splice(0, 0, tagName + pathIndex);
}
return paths.length ? "/" + paths.join("/") : null;
}
// 监听DOM变化来支持动态加载的内容
const observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.addedNodes.length) {
init(); // 如果检测到新增节点,则重新初始化
}
});
});
observer.observe(document.body, { childList: true, subtree: true });
init(); // 初始执行
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址