Speed Github Releases

加速 github release 页面的下载

当前为 2024-09-06 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Speed Github Releases
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 加速 github release 页面的下载
  6. // @author CBK
  7. // @license GPL-3.0
  8. // @match https://github.com/*
  9. // @icon https://github.githubassets.com/favicons/favicon.svg
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. 'use strict';
  14.  
  15. main()
  16.  
  17. function main(){
  18. // 寻找 release 地址
  19. let elems = document.querySelectorAll('[href]')
  20. speed(elems)
  21. }
  22.  
  23.  
  24. function speed(elems){
  25. let mirror_url = 'https://github.moeyy.xyz/'
  26. let pattern = /https:\/\/github.com\/.+\/.+\/releases\/download.+/
  27. for(let elem of elems) {
  28. if(elem.href.match(pattern))
  29. // 修改
  30. elem.href = mirror_url + elem.href
  31. }
  32. }
  33.  

QingJ © 2025

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