ANT Buffer Size

ANT Buffer Size Calculator

当前为 2024-02-23 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name ANT Buffer Size
  3. // @namespace Violentmonkey Scripts
  4. // @match https://anthelion.me/*
  5. // @version 1.0 (2/15/2024)
  6. // @author ANThusiast
  7. // @description ANT Buffer Size Calculator
  8. // @license MIT
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var targetLiId = 'stats_seeding';
  15. var targetLiLeechId = 'stats_leeching';
  16. var requiredRatio = 'stats_required';
  17.  
  18.  
  19. var targetLi = document.getElementById(targetLiId);
  20. var targetLiLeech = document.getElementById(targetLiLeechId);
  21. var targetLiRequiredRatio = document.getElementById(requiredRatio);
  22.  
  23. if (targetLi) {
  24. var uploadValue = parseFloat(targetLi.querySelector('.stat.tooltip').textContent);
  25. var requiredRatioValue = parseFloat(targetLiRequiredRatio.querySelector('.stat.tooltip').textContent);
  26. var multiplierValue = (1 / requiredRatioValue);
  27. var bufferValue = (uploadValue * multiplierValue).toFixed(2);
  28. // For 0.60 required ratio, when you do not seed.
  29. var noSeedbufferValue = (uploadValue * 1.66).toFixed(2);
  30. var bufferLi = document.createElement('li');
  31. bufferLi.innerHTML = '<a href="https://anthelion.me/wiki.php?action=article&name=ratio">Buffer</a>: <span class="stat tooltip" style="color: #53f60d;font-weight:600;">' + bufferValue + '</span> / <span class="stat tooltip" style="color: #ff001b;font-weight:600;">' + noSeedbufferValue + '</span> TiB';
  32. targetLiLeech.parentNode.insertBefore(bufferLi, targetLiLeech.nextSibling);
  33. }
  34. })();

QingJ © 2025

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