Play stripchat or chaturbate videos with potplayer,vlc,nplayer,mpv, etc V2

Play stripchat or chaturbate videos with potplayer,vlc,nplayer,mpv, etc.

  1. // ==UserScript==
  2. // @match *://*.stripchat.com/*
  3. // @match *://*.instantfapcams.com/*
  4. // @match *://*.xhamsterlive.com/*
  5. // @match *://*.cambb.xxx/models/stripchat/*
  6. // @match *://*.nudecams.xxx/models/stripchat/*
  7. // @match *://*.cambb.xxx/models/chaturbate/*
  8. // @match *://*.nudecams.xxx/models/chaturbate/*
  9. // @match *://chaturbate.com/*
  10. // @name Play stripchat or chaturbate videos with potplayer,vlc,nplayer,mpv, etc V2
  11. // @description Play stripchat or chaturbate videos with potplayer,vlc,nplayer,mpv, etc.
  12. // @namespace https://greasyfork.org/zh-CN/scripts/473187
  13. // @version 2.7
  14. // @license MIT
  15. // ==/UserScript==
  16.  
  17. window.onload = (function() {
  18. 'use strict';
  19.  
  20. let LNK = [
  21. "edge4-sof.live.mmcdn.com",
  22. "edge11-sof.live.mmcdn.com",
  23. "edge8-sof.live.mmcdn.com",
  24. "edge1-sof.live.mmcdn.com",
  25. "edge6-sof.live.mmcdn.com",
  26. "edge9-rtm.live.mmcdn.com",
  27. "edge10-rtm.live.mmcdn.com",
  28. "edge11-rtm.live.mmcdn.com",
  29. "edge16-rtm.live.mmcdn.com",
  30. "edge13-sea.live.mmcdn.com",
  31. "edge14-sea.live.mmcdn.com",
  32. "edge15-sea.live.mmcdn.com",
  33. "edge20-waw.live.mmcdn.com",
  34. "edge23-waw.live.mmcdn.com",
  35. "edge33-waw.live.mmcdn.com"
  36. ];
  37.  
  38. let H264 = [
  39. "153efedff9d6c16cc6737324ed27f8cf9a685b8e1adea420a26215bb07e5cd14_trns_h264",
  40. "2b46600bfcbf56e72f293118c6a1681f028f3d608ebbc6debc629534f9bba048_trns_h264",
  41. "3faa01ec0eeff90b6b4e37446b1969a873dd5a14d364696ae959ed6cf40d1a79_trns_h264",
  42. "7e007268ecf7d1bf2699f68bbd9df998638cfbd047845b134ae7b856a3f1acf5_trns_h264",
  43. "a78ea4c10d2edcefbffabc5c2b4769da6419313ac8f95d68d5b4b335926981f8_trns_h264",
  44. "554ae457e0310b5711f0a11ddc6a221ba756caf2762b69225dab3d272c73d5e7_trns_h264",
  45. ];
  46.  
  47. let live_url_num = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24'];
  48.  
  49. function btn_com(btn_name, player_name, player_url, copy_url = false) {
  50. let btn = document.createElement("button");
  51. btn.innerHTML = player_name;
  52. btn.style.width = "100px";
  53. btn.style.height = "30px";
  54. btn.style.align = "top";
  55. btn.style.color = "white";
  56. btn.style.background = "#2b2b2b";
  57. btn.style.border = "1px solid #e33e33";
  58. btn.style.borderRadius = "8px";
  59. btn.style.fontSize = "16px";
  60. btn.onclick = function() {
  61. //if (document.location.hostname === "chaturbate.com" && !document.location.pathname.includes("/fullvideo/")) {
  62. let live_url;
  63. if (document.location.hostname === "cambb.xxx" || document.location.hostname === "camconsole.com" || document.location.hostname === "nudecams.xxx" || document.location.hostname === "chaturbate.com" || document.location.hostname === "stripchat.com" || document.location.hostname === "xhamsterlive.com" || document.location.hostname === "instantfapcams.com") {
  64. if (document.location.pathname.includes("/models/chaturbate") || document.location.hostname === "chaturbate.com") {
  65. let random_LNK = LNK[Math.floor(Math.random() * LNK.length)];
  66. let random_H264 = H264[Math.floor(Math.random() * H264.length)];
  67. let username;
  68. if (document.location.hostname === "chaturbate.com" && !document.location.pathname.includes("/fullvideo/")) {
  69. username = document.location.pathname.split("/")[1];
  70. live_url = "https://" + random_LNK + "/live-hls/amlst:" + username + "-sd-" + random_H264 + "/playlist.m3u8";
  71. }
  72. else if (document.location.pathname.includes("/fullvideo/")) {
  73. let matches = document.location.href.match(/chaturbate\.com\/fullvideo\/\?b=([^&]+)/);
  74. let username = matches ? matches[1] : null;
  75. console.log("Username: " + username);
  76. live_url = "https://" + random_LNK + "/live-hls/amlst:" + username + "-sd-" + random_H264 + "/playlist.m3u8";
  77. } else {
  78. username = document.location.href.split(/[=/]/).pop();
  79. live_url = "https://" + random_LNK + "/live-hls/amlst:" + username + "-sd-" + random_H264 + "/playlist.m3u8";
  80. }
  81. } if (document.location.pathname.includes("/models/stripchat")) {
  82. let p = document.querySelector('#livestream-player').getAttribute('data-src');
  83. let live_id = p.match(/\d+/g)[1];
  84. let url_num = live_url_num[Math.floor(Math.random() * live_url_num.length)];
  85. live_url = "https://b-hls-" + url_num + ".doppiocdn.com/hls/" + live_id + "/" + live_id + ".m3u8";
  86. } else if (document.location.hostname === "stripchat.com" || document.location.hostname === "xhamsterlive.com" || document.location.hostname === "instantfapcams.com") {
  87. let p = document.querySelector('.video-element-wrapper-blur.with-blur').querySelector('.image-background').src;
  88. let live_id = p.match(/\d+/g)[1];
  89. let url_num = live_url_num[Math.floor(Math.random() * live_url_num.length)];
  90. live_url = "https://b-hls-" + url_num + ".doppiocdn.com/hls/" + live_id + "/" + live_id + ".m3u8";
  91. }
  92. }
  93. console.log("Live URL: " + live_url);
  94.  
  95. if (copy_url) {
  96. navigator.clipboard.writeText(live_url).then(function() {
  97. alert("Link copied to clipboard:\n" + live_url);
  98. }).catch(function(err) {
  99. console.error('Unable to copy text to clipboard', err);
  100. });
  101. } else {
  102. window.open(live_url);
  103. }
  104. };
  105. const addBtn = () => {
  106. if (document.location.hostname === "cambb.xxx" || document.location.hostname === "nudecams.xxx") {
  107. document.querySelector(".col-12.model-iframe").prepend(btn);
  108. } else if (document.location.hostname === "stripchat.com" || document.location.hostname === "xhamsterlive.com" || document.location.hostname === "instantfapcams.com") {
  109. document.querySelector("#portal-root").prepend(btn);
  110. } else if (document.location.hostname === "camconsole.com") {
  111. document.querySelector(".separator-2").prepend(btn);
  112. } else if (document.location.pathname.includes("/models/chaturbate")) {
  113. document.querySelector(".videoPlayerDiv").prepend(btn);
  114. } else {
  115. document.querySelector(".videoPlayerDiv").prepend(btn);
  116. }
  117. };
  118.  
  119. if (document.readyState === "complete") {
  120. addBtn();
  121. } else {
  122. window.addEventListener("load", addBtn);
  123. }
  124. }
  125.  
  126. btn_com("btn0", "Copy Link", "", true);
  127. btn_com("btn1", "Open Link", "https://playhls.com/?url=");
  128. btn_com("btn2", "mpv", "mpv://");
  129. btn_com("btn3", "vlc", "vlc://");
  130. btn_com("btn4", "potplayer", "potplayer://");
  131. btn_com("btn5", "nplayer", "nplayer-");
  132. })();