Flash Collector for 4399

Flash Collector 辅助脚本,用于解除 4399.com 的源站播放限制

当前为 2022-05-15 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Flash Collector for 4399
  3. // @namespace Flash Collector Scripts
  4. // @match *://*.4399.com/*
  5. // @grant none
  6. // @license MPL-2.0
  7. // @version 1.0
  8. // @author Cnotech
  9. // @description Flash Collector 辅助脚本,用于解除 4399.com 的源站播放限制
  10. // ==/UserScript==
  11.  
  12. function next() {
  13. let m=document.location.hash.match(/next=[^&]+/)
  14. if(m==null) return null
  15. return m[0].split("=")[1]
  16. }
  17.  
  18. function jump(url) {
  19. console.log(`Jump to ${url}`)
  20. document.location.href=url
  21. }
  22.  
  23. function main() {
  24. //读取hash
  25. const hash=document.location.hash
  26.  
  27. //匹配标记
  28. let m=hash.match(/#flash-collector-\d/)
  29. if(m==null) return
  30. let step=Number(m[0].slice(-1))
  31.  
  32. //状态机
  33. const cur=document.location.href.split("#")[0]
  34. switch (step) {
  35. case 0:
  36. //跳转到 4399 首页
  37. jump(`http://www.4399.com/#flash-collector-1?next=${cur}`)
  38. break
  39. case 1:
  40. //跳回真实页面
  41. let n=next()
  42. if(n) jump(n)
  43. break
  44. }
  45. }
  46. main()

QingJ © 2025

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