DeepSeek Auto-Regenerate

Automatically retries when DeepSeek shows "server busy" messages

当前为 2025-03-04 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name DeepSeek Auto-Regenerate
  3. // @description Automatically retries when DeepSeek shows "server busy" messages
  4. // @match *://*.deepseek.com/*
  5. // @match *://*.deepseek.ai/*
  6. // @grant none
  7. // @version 0.0.1.20250304102757
  8. // @namespace http://deepseek.auto.regenerate
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. // Create observer to watch for server busy messages
  14. const observer = new MutationObserver(() => {
  15. // Look for server busy messages
  16. document.querySelectorAll('.ds-markdown p').forEach(p => {
  17. if (p.textContent === "The server is busy. Please try again later.") {
  18. // Find retry button (second button in container)
  19. const container = p.closest('.f9bf7997');
  20. if (container) {
  21. const buttons = container.querySelectorAll('.ds-icon-button');
  22. if (buttons.length >= 2) {
  23. // Click retry button with small delay
  24. setTimeout(() => buttons[1].click(), 500);
  25. }
  26. }
  27. }
  28. });
  29. });
  30. // Start observing
  31. observer.observe(document.body, {
  32. childList: true,
  33. subtree: true
  34. });
  35. // Initial check for existing messages
  36. setTimeout(() => {
  37. document.querySelectorAll('.ds-markdown p').forEach(p => {
  38. if (p.textContent === "The server is busy. Please try again later.") {
  39. const container = p.closest('.f9bf7997');
  40. if (container) {
  41. const buttons = container.querySelectorAll('.ds-icon-button');
  42. if (buttons.length >= 2) buttons[1].click();
  43. }
  44. }
  45. });
  46. }, 1000);
  47. })();