Kemono Video Linker & Image Loader

Turns the video name into a clickable link, and automatically loads image previews.

  1. // ==UserScript==
  2. // @name Kemono Video Linker & Image Loader
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.1
  5. // @description Turns the video name into a clickable link, and automatically loads image previews.
  6. // @author https://github.com/xskutsu/
  7. // @match *://kemono.party/*
  8. // @match *://kemono.su/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=kemono.party
  10. // @grant none
  11. // @run-at document-end
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. "use strict";
  17. window.addEventListener("load", function () {
  18. setInterval(function () {
  19. if (window.location.href.split("/").filter(o => o.length > 1).splice(-2, 1)[0] !== "post") return;
  20. document.querySelectorAll('.post__video').forEach(videoElement => {
  21. const summary = videoElement.parentElement.parentElement.children[0];
  22. const videoSource = videoElement.children[0].src;
  23. const link = document.createElement('a');
  24. link.textContent = summary.textContent;
  25. link.href = videoSource;
  26. link.target = '_blank';
  27. link.appendChild(document.createElement('br'));
  28. summary.parentElement.prepend(link);
  29. summary.remove();
  30. videoElement.classList.remove("post__video");
  31. });
  32. const thumbnails = document.querySelectorAll('.post__thumbnail');
  33. thumbnails.forEach((thumbnail, index) => {
  34. setTimeout(() => {
  35. const targetElement = thumbnail.children[0]?.children[0];
  36. if (targetElement?.classList.contains('image-link')) {
  37. targetElement.children[0]?.click();
  38. thumbnail.classList.remove("post__thumbnail");
  39. }
  40. }, index * 800);
  41. });
  42. }, 1000);
  43. });
  44. })();