Deepl No Limit

Unlimited DeepL Translation

  1. // ==UserScript==
  2. // @name Deepl No Limit
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Unlimited DeepL Translation
  6. // @author null
  7. // @match https://*.deepl.com/translator
  8. // @match https://*.deepl.com/*/translator
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Intercept network requests
  17. const originalFetch = window.fetch;
  18. window.fetch = async function(url, options) {
  19. // Check if the request is the one we need to intercept
  20. if (url.startsWith('https://w.deepl.com/web') && options && options.method === 'post') {
  21. // Perform the original fetch request
  22. const response = await originalFetch(url, options);
  23.  
  24. // Clone the response so we can manipulate it
  25. const clonedResponse = response.clone();
  26. const jsonResponse = await clonedResponse.json();
  27.  
  28. // Modify the JSON response
  29. if (jsonResponse.result && jsonResponse.result.proAvailable) {
  30. jsonResponse.result.proAvailable = false;
  31. }
  32.  
  33. // Create a new response with the modified JSON
  34. const modifiedResponse = new Response(JSON.stringify(jsonResponse), {
  35. status: clonedResponse.status,
  36. statusText: clonedResponse.statusText,
  37. headers: clonedResponse.headers,
  38. });
  39.  
  40. // Return the modified response
  41. return modifiedResponse;
  42. }
  43.  
  44. // If it's not the URL we want to intercept, proceed as normal
  45. return originalFetch(url, options);
  46. };
  47. })();