DoujinStyle Auto Redirect to download

REQUIRES https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/ or similar addon that modifies CORS headers to work!

  1. // ==UserScript==
  2. // @name DoujinStyle Auto Redirect to download
  3. // @namespace Violentmonkey Scripts
  4. // @match https://doujinstyle.com/?p=page&type=1&id=*
  5. // @grant none
  6. // @version 1.1
  7. // @author moh
  8. // @license MIT
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=doujinstyle.com
  10. // @description REQUIRES https://addons.mozilla.org/en-US/firefox/addon/cors-everywhere/ or similar addon that modifies CORS headers to work!
  11. // ==/UserScript==
  12.  
  13. (async function() {
  14. 'use strict';
  15.  
  16. const form = document.querySelector('mainbar form');
  17. const result = await fetch(form.action, {
  18. "headers": {
  19. "Content-Type": "application/x-www-form-urlencoded",
  20. },
  21. "body": (new URLSearchParams(new FormData(form))) + '&download_link=',
  22. "method": "POST",
  23. "redirect": "follow"
  24. });
  25. window.location = result.url;
  26.  
  27. })();