Sleazy Fork is available in English.

Thothub - Add Download Button

Add a download button to the video player

  1. // ==UserScript==
  2. // @name Thothub - Add Download Button
  3. // @namespace Thothub - Add Download Button
  4. // @version 0.1
  5. // @description Add a download button to the video player
  6. // @author You
  7. // @include *thothub.*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. setTimeout(() => {
  16. // Get the video source URL
  17. var videoSrc = document.querySelector('video').src; //alternatively .fp-engine
  18. if (!videoSrc) {
  19. console.error('Video source not found');
  20. return;
  21. }
  22.  
  23. // Create the Download list item
  24. var downloadListItem = document.createElement('li');
  25. downloadListItem.innerHTML = `<a href="${videoSrc}" download>Download Video</a>`;
  26.  
  27. // Find the Favourites button dropdown
  28. var favouritesDropdown = document.querySelector('.btn-favourites ul');
  29. if (!favouritesDropdown) {
  30. console.error('Favourites dropdown not found');
  31. return;
  32. }
  33.  
  34. // Append the Download option to the dropdown
  35. favouritesDropdown.appendChild(downloadListItem);
  36. }, 4000);
  37. })();