豆瓣 - 搜索电影资源

在豆瓣电影页面显示影视资源搜索页的直达链接

  1. // ==UserScript==
  2. // @name 豆瓣 - 搜索电影资源
  3. // @namespace 豆瓣/电影/电视剧
  4. // @description: 豆瓣电影页面显示影视资源搜索页的直达链接
  5. // @match *://movie.douban.com/subject/*
  6. // @version 0.0.2
  7. // @license MIT
  8. // @author 1771245847
  9. // @description 在豆瓣电影页面显示影视资源搜索页的直达链接
  10. // ==/UserScript==
  11. (function () {
  12. var host = location.hostname;
  13. if (host === 'movie.douban.com') {
  14. const title = document.querySelector('title').innerText.replace(/(^\s*)|(\s*$)/g, '').replace(' (豆瓣)', '');
  15. const subjectwrap = document.querySelector('h1');
  16. const subject = document.querySelector('.year');
  17. if (!subjectwrap || !subject) {
  18. return;
  19. }
  20. const sectl = document.createElement('span');
  21. subjectwrap.insertBefore(sectl, subject.nextSibling);
  22. sectl.insertAdjacentHTML('beforebegin',
  23. `<style>.cupfox{vertical-align: middle;}.cupfox:hover{background: #fff!important;}</style>
  24. <a href="http://soupian.pro/search?key=${title}" class="cupfox" target="_blank">
  25. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  26. <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xli
  27. nk="http://www.w3.org/1999/xlink" x="0px" y="0px" width="32px" height="23px"
  28. viewBox="0 0 32 23" enable-background="new 0 0 32 23" xml:space="preserve">
  29. <image id="image0" width="32" height="23" x="0" y="0" xlink:href="https://soupian.pro/favicon.ico"/></svg></a>`);
  30. }
  31. })();

QingJ © 2025

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