影视网页标题清理

从疑似影视网页的标题提取片名与集数重新显示

目前為 2023-05-15 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 影视网页标题清理
  3. // @version 6
  4. // @description 从疑似影视网页的标题提取片名与集数重新显示
  5. // @author Lemon399
  6. // @match *://*/*
  7. // @grant none
  8. // @namespace https://gf.qytechs.cn/users/452911
  9. // ==/UserScript==
  10.  
  11. function matcher(title) {
  12. let result = "";
  13. const regex = /^(?:.*《)?([^》]+?)(?=(?:第|\s)?(\d+)集|》).*$/;
  14. const regrst = title.match(regex);
  15. if (regrst) {
  16. const [_full, vname, num] = regrst;
  17. const numtxt = num ? " " + num.padStart(2, "0") : "";
  18. if (vname) result = `${vname.trim()}${numtxt}`;
  19. }
  20. return result;
  21. }
  22.  
  23. const title = document.title;
  24. const parsed = matcher(title);
  25. if (parsed) document.title = parsed;

QingJ © 2025

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