Greasy Fork

Greasy Fork is available in English.

百度云提取码

gamer520自动填写密码、百度云提取码

当前为 2024-10-29 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        百度云提取码
// @namespace   Violentmonkey Scripts
// @match       https://*.gamer520.com/*.html
// @grant       none
// @version     1.0
// @license     MIT
// @author      -
// @description gamer520自动填写密码、百度云提取码
// ==/UserScript==


const pwdBh = ()=>{
  const pwdDom = document.querySelector(".entry-title");
  if (pwdDom) {
    const pwd = pwdDom.textContent.match(/\w+/)?.[0];
    const passwordInput = document.querySelector("input[name='post_password']");
    if (pwd && passwordInput) {
      passwordInput.value = pwd;
      const submitButton = document.querySelector("input[name='Submit']");
      submitButton?.click();
    }
  }
}
const baiduyunSuff = ()=>{
  var aTags = document.querySelectorAll('.entry-content.u-text-format.u-clearfix a');
  aTags.forEach(aTag => {
    if (aTag.textContent.includes("pan.baidu.com")) {
      let nextSibling = aTag.parentNode.nextSibling;
      while (nextSibling && nextSibling.nodeType !== Node.ELEMENT_NODE) {
        nextSibling = nextSibling.nextSibling;
      }
      if (nextSibling && (tqm = nextSibling.textContent.match(/\w+/)?.[0])) {
        aTag.href += `?pwd=${tqm}`;
        aTag.textContent += `?pwd=${tqm}`;
        aTag.style.color = "red";
      }
    }
  })
}
setTimeout(()=>{
  // 填充密码
  pwdBh()
  // 百度云链接添加提取码后缀
  baiduyunSuff()
},1000)