youtube一键搜bilibili

在油管一键搜b站同名视频

  1. // ==UserScript==
  2. // @name youtube一键搜bilibili
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1.1.4
  5. // @description 在油管一键搜b站同名视频
  6. // @author 王泥巴
  7. // @match https://*.youtube.com/*
  8. // @grant none
  9. // @license GPL-3.0-only
  10. // ==/UserScript==
  11. // @code https://gf.qytechs.cn/zh-CN/scripts/397246
  12.  
  13. (function() {
  14. let interval = setInterval(function(){
  15. //let containerH1 = document.querySelector("#title > h1 > yt-formatted-string")
  16. let containerH1 = document.querySelector("#container > h1 > yt-formatted-string")
  17. containerH1.style.display="inline"
  18. let bilibiliSearch = document.querySelector("#bilibiliSearch")
  19. if (!bilibiliSearch) {
  20. let addLink = " <a href='' target='_blank' style='font-size: 1px;' id='bilibiliSearch'>一键搜B站</a>"
  21. bilibiliSearch = containerH1.insertAdjacentHTML('afterend', addLink);
  22. }
  23. let searchLink = "https://search.bilibili.com/all?keyword=" + containerH1.textContent.trim()
  24. if (bilibiliSearch.href != searchLink) {
  25. bilibiliSearch.href = searchLink
  26. }
  27.  
  28. let divUperName = document.querySelector("#text-container")
  29. divUperName.style.display="inline"
  30. let bilibiliSearchUperName = document.querySelector("#bilibiliSearchUperName")
  31. if (!bilibiliSearchUperName) {
  32. let addLink = " <a href='' target='_blank' style='font-size: 1px;' id='bilibiliSearchUperName'>一键搜B站</a>"
  33. bilibiliSearchUperName = divUperName.insertAdjacentHTML('afterend', addLink);
  34. }
  35. let searchLinkUperName = "https://search.bilibili.com/upuser?keyword=" + divUperName.textContent.trim()
  36. if (bilibiliSearchUperName.href != searchLinkUperName) {
  37. bilibiliSearchUperName.href = searchLinkUperName
  38. }
  39.  
  40.  
  41. }, 500);
  42. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址