theYNC.com Underground bypass

Watch theYNC Underground videos without needing an account

目前為 2024-12-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name theYNC.com Underground bypass
  3. // @description Watch theYNC Underground videos without needing an account
  4. // @namespace Violentmonkey Scripts
  5. // @match https://theync.com/*
  6. // @match https://theync.net/*
  7. // @match https://theync.org/*
  8. // @grant none
  9. // @version 1.2
  10. // @license MIT
  11. // @author -
  12. // ==/UserScript==
  13. function getTheYNCVideoURL(url) {
  14. for (const [, group_url] of url.matchAll(
  15. /https:\/\/theync.com\/media\/thumbs\/(.*?)\.[a-zA-Z0-9_.-]*/gm
  16. )) {
  17. return `https://media.theync.com/videos/${group_url}.mp4`;
  18. }
  19. }
  20. function waitForElm(selector) {
  21. return new Promise((resolve) => {
  22. if (document.querySelector(selector)) {
  23. return resolve(document.querySelector(selector));
  24. }
  25.  
  26. const observer = new MutationObserver((mutations) => {
  27. if (document.querySelector(selector)) {
  28. observer.disconnect();
  29. resolve(document.querySelector(selector));
  30. }
  31. });
  32.  
  33. // If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336
  34. observer.observe(document.body, {
  35. childList: true,
  36. subtree: true,
  37. });
  38. });
  39. }
  40.  
  41. waitForElm(".content-block").then((contentBlock) =>
  42. contentBlock
  43. .querySelectorAll(".inner-block > a:has(>.item-info>.border-gold)")
  44. .forEach((element) => {
  45. const thumbnailURL = element.querySelector(".image > img").src;
  46. if (thumbnailURL) {
  47. const videoURL = getTheYNCVideoURL(thumbnailURL);
  48. if (videoURL) {
  49. element.href = getTheYNCVideoURL(thumbnailURL);
  50. }
  51. }
  52. })
  53. );
  54. waitForElm(".content-block").then((contentBlock) => {
  55. contentBlock
  56. .querySelectorAll(".upgrade-profile > .upgrade-info-block")
  57. .forEach((element) => {
  58. const thumbnailURL = element.querySelector(".image-block > .image > img").src;
  59. if (thumbnailURL) {
  60. const videoURL = getTheYNCVideoURL(thumbnailURL);
  61. if (videoURL) {
  62. location.href = videoURL;
  63. }
  64. }
  65. })
  66. contentBlock
  67. .querySelectorAll(".inner-block > a:has(>.item-info>.border-gold)")
  68. .forEach((element) => {
  69. const thumbnailURL = element.querySelector(".image > img").src;
  70. if (thumbnailURL) {
  71. const videoURL = getTheYNCVideoURL(thumbnailURL);
  72. if (videoURL) {
  73. element.href = getTheYNCVideoURL(thumbnailURL);
  74. }
  75. }
  76. })
  77. }
  78.  
  79. );