Sleazy Fork is available in English.

Chaturbate reloaded

Gives you a new and improved chaturbate experience.

  1. // ==UserScript==
  2. // @name Chaturbate reloaded
  3. // @name:de Chaturbate reloaded
  4. // @name:es Chaturbate reloaded
  5. // @name:es-CO Chaturbate reloaded
  6. // @name:it Chaturbate reloaded
  7. // @name:fr Chaturbate reloaded
  8. // @name:fr-CA Chaturbate reloaded
  9. // @name:ru Chaturbate reloaded
  10. // @name:tr Chaturbate reloaded
  11. // @name:ro Chaturbate reloaded
  12. // @name:no Chaturbate reloaded
  13. // @name:nl Chaturbate reloaded
  14. // @name:pl Chaturbate reloaded
  15. // @name:ja Chaturbate reloaded
  16. // @name:el Chaturbate reloaded
  17. // @name:hu Chaturbate reloaded
  18. // @name:fi Chaturbate reloaded
  19. // @name:ar Chaturbate reloaded
  20. // @name:hi Chaturbate reloaded
  21. // @name:id Chaturbate reloaded
  22. // @name:ko Chaturbate reloaded
  23. // @name:pt-PT Chaturbate reloaded
  24. // @name:pt-BR Chaturbate reloaded
  25. // @name:zh Chaturbate reloaded
  26. // @name:zh-CN Chaturbate reloaded
  27. // @name:zh-TW Chaturbate reloaded
  28. // @name:cs Chaturbate reloaded
  29. // @name:sk Chaturbate reloaded
  30. // @name:sl Chaturbate reloaded
  31. // @name:sv Chaturbate reloaded
  32. // @description Gives you a new and improved chaturbate experience.
  33. // @description:de Gibt Ihnen ein neues und verbessertes Chaturbate erlebnis.
  34. // @description:es Te brinda una experiencia de chaturbate nueva y mejorada.
  35. // @description:es-CO Te brinda una experiencia de chaturbate nueva y mejorada.
  36. // @description:it Ti dà un'esperienza di chaturbate nuova e migliorata.
  37. // @description:fr Vous donne une nouvelle expérience de chaturbate améliorée.
  38. // @description:fr-CA Vous donne une nouvelle expérience de chaturbate améliorée.
  39. // @description:ru Дает вам новый и улучшенный опыт Chaturbate.
  40. // @description:tr Size yeni ve geliştirilmiş bir Chaturbate deneyimi sunar.
  41. // @description:ro Vă oferă o experiență de chaturbate nouă și îmbunătățită.
  42. // @description:no Gir deg en ny og forbedret Chaturbate opplevelse.
  43. // @description:nl Geeft u een nieuwe en verbeterde chaturbate ervaring.
  44. // @description:pl Daje nowe i ulepszone doświadczenie chaturbate.
  45. // @description:ja 新しい改善されたChaturbateエクスペリエンスを提供します。
  46. // @description:el Σας δίνει μια νέα και βελτιωμένη εμπειρία chaturbate.
  47. // @description:hu Új és továbbfejlesztett Chaturbate élményt nyújt.
  48. // @description:fi Antaa sinulle uuden ja parannetun Chaturbate kokemuksen.
  49. // @description:ar يمنحك تجربة Chaturbate جديدة ومحسّنة.
  50. // @description:hi आपको एक नया और बेहतर चैटबेट अनुभव देता है।
  51. // @description:id Memberi Anda pengalaman chaturbate yang baru dan lebih baik.
  52. // @description:ko 새롭고 개선 된 Chaturbate 경험을 제공합니다.
  53. // @description:pt-PT Dá a você uma experiência chaturbate nova e aprimorada.
  54. // @description:pt-BR Dá a você uma experiência chaturbate nova e aprimorada.
  55. // @description:zh 为您提供新的和改进的Chaturbate体验。
  56. // @description:zh-CN 为您提供新的和改进的Chaturbate体验。
  57. // @description:zh-TW 为您提供新的和改进的Chaturbate体验。
  58. // @description:cs Poskytuje vám nový a vylepšený zážitek z chaturebate.
  59. // @description:sk Vylepšuje Chaturbate pridaním viacerých nových funkcií.
  60. // @description:sl Poskytuje vám nový a vylepšený zážitok z chatrba.
  61. // @description:sv Ger dig en ny och förbättrad chaturbate upplevelse.
  62. // @version 1.5.1
  63. // @namespace chaturbate_goes_Ladroop
  64. // @match https://*chaturbate.com/*
  65. // @match https://*.chaturbate.com/*
  66. // @exclude https://secure.chaturbate.com/*
  67. // @exclude https://*chaturbate.com/security/
  68. // @exclude https://*chaturbate.com/apps/*
  69. // @exclude https://*chaturbate.com/api/*
  70. // @exclude https://*chaturbate.com/b/*
  71. // @exclude https://*chaturbate.com/fullvideo/*
  72. // @exclude https://*chaturbate.com/accounts/followers/*
  73. // @require https://cdn.jsdelivr.net/npm/hls.js@1/dist/hls.min.js
  74. // @grant window.focus
  75. // @grant GM_xmlhttpRequest
  76. // @connect translate.googleapis.com
  77. // @run-at document-end
  78. // @license MIT
  79. // @copyright 2025 Ladroop
  80. // ==/UserScript==
  81.  
  82. (function() {
  83. 'use strict';
  84. var scinfo=GM_info;
  85. var version=scinfo.script.version;
  86. var scriptname=scinfo.script.name;
  87. var i=0;
  88. var n=0;
  89. var currpage=document.location.href;
  90. var domain="https://"+window.location.hostname+"/";
  91. var ppage=false;
  92. var biodata="";
  93. var referenceNode="";
  94. var roomname= currpage.split("/")[3];
  95. if (roomname =="p"){
  96. ppage=true;
  97. }
  98. var hls_source = "";
  99. var fetching=0;
  100. var hlsfetching=false;
  101. var loggedin=false;
  102. var yourname="";
  103. var username="";
  104. var br="";
  105. var vfilter="brightness(100%) contrast(100%) invert(0%) saturate(100%) hue-rotate(0deg)";
  106. var ofils="";
  107. var vmirror="none";
  108. var pos1=0;
  109. var pos2=0;
  110. var pos3=0;
  111. var pos4=0;
  112. var vareaid="";
  113. if (document.querySelector('[data-testid="username"]')){
  114. loggedin=true;
  115. yourname=document.querySelector('[data-testid="username"]').innerHTML;
  116. }
  117. var observer4=new MutationObserver(adjusthumbs);
  118. var observerConfig4 ={attributes : true, attributeFilter : ['class'] };
  119. var observer41=new MutationObserver(adjusthumbs);
  120. var observer5=new MutationObserver(adjustbiohumbs);
  121. var observerConfig5 ={attributes : true, attributeFilter : ['style'] };
  122. var observer6=new MutationObserver(adjustfollowhumbs);
  123. var observerConfig6 ={attributes : true, attributeFilter : ['style'] };
  124. var observer7=new MutationObserver(nextcam);
  125. var observerConfig7 ={attributes : true, attributeFilter : ['title'] };
  126. var observerConfig7a ={attributes : true, attributeFilter : ['title'] };
  127. var observer8=new MutationObserver(restart);
  128. var observerConfig8 ={attributes : true, attributeFilter : ['class'] };
  129. var observer3 = new MutationObserver(varea);
  130. var observerConfig3 = {childList: true, subtree: true};
  131. var tabblink=false;
  132. var ctitle=document.title;
  133. var container="";
  134. var bio=false;
  135. var thisfap="";
  136. var fapbr="";
  137. var cimg = new Image();
  138. var pimg = new Image();
  139. var usernoteslist = "";
  140. var stor="greg44609";
  141. var tour=domain+"in/?tour=4uT2&campaign=hgg5k&track=default";
  142. var note='<svg style="height: 2.0em; width: 2.0em;" viewBox="0 0 12 12" xmlns="https://www.w3.org/2000/svg"><path fill="hsla(0, 100%, 50%, 0.8)" d="M5.5 2.00002H2C1.73478 2.00002 1.48043 2.10537 1.29289 2.29291C1.10536 2.48044 1 2.7348 1 3.00002V10C1 10.2652 1.10536 10.5196 1.29289 10.7071C1.48043 10.8947 1.73478 11 2 11H9C9.26522 11 9.51957 10.8947 9.70711 10.7071C9.89464 10.5196 10 10.2652 10 10V6.50002" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.25 1.24985C9.44891 1.05094 9.7187 0.939194 10 0.939194C10.2813 0.939194 10.5511 1.05094 10.75 1.24985C10.9489 1.44877 11.0607 1.71855 11.0607 1.99985C11.0607 2.28116 10.9489 2.55094 10.75 2.74985L6 7.49985L4 7.99985L4.5 5.99985L9.25 1.24985Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>';
  143. var nonote='<svg style="height: 2.0em; width: 2.0em;" viewBox="0 0 12 12" xmlns="https://www.w3.org/2000/svg"><path fill="hsla(197, 10%, 98%, 0.3)" d="M5.5 2.00002H2C1.73478 2.00002 1.48043 2.10537 1.29289 2.29291C1.10536 2.48044 1 2.7348 1 3.00002V10C1 10.2652 1.10536 10.5196 1.29289 10.7071C1.48043 10.8947 1.73478 11 2 11H9C9.26522 11 9.51957 10.8947 9.70711 10.7071C9.89464 10.5196 10 10.2652 10 10V6.50002" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path><path d="M9.25 1.24985C9.44891 1.05094 9.7187 0.939194 10 0.939194C10.2813 0.939194 10.5511 1.05094 10.75 1.24985C10.9489 1.44877 11.0607 1.71855 11.0607 1.99985C11.0607 2.28116 10.9489 2.55094 10.75 2.74985L6 7.49985L4 7.99985L4.5 5.99985L9.25 1.24985Z" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>';
  144. var notegrey='<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 12 12" role="img"><path stroke="#48484E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M5.5 2H2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V6.5"></path><path stroke="#48484E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9.25 1.25a1.06 1.06 0 0 1 1.5 1.5L6 7.5 4 8l.5-2z"></path></svg>';
  145. var tr2="https://www.chaturbate.com/translate_a/";
  146. if (currpage.indexOf(stor)!=-1){document.location.href=domain;}
  147. var discoverpage=false;
  148. var thumbpage=false;
  149. var tagspage=false;
  150. var openthumbname="";
  151. var opennote="";
  152. var data="";
  153. var room_status="";
  154. var videoSrc="";
  155. var cmaf=true;
  156. var stream;
  157. var vidwidth=854;
  158. var hls = new Hls();
  159. var gojpg=false;
  160. var fatalerror=0;
  161. var recording=false;
  162. var recpause=false;
  163. var mediaRecorder;
  164. var recordedBlobs=[];
  165. var recname="";
  166. var hidurl=domain+"api/ts/roomlist/room-list/?&hidden=true&limit=90&offset=";
  167. var hprom=false;
  168. var hidoffset=0;
  169. var hiddenarray=[];
  170. var region=["asia","europe_russia","northamerica","southamerica","other"];
  171. var niceregion=["Asia","Europe/Russia","North America","South America","Other (Australia, Africa, etc.)"];
  172. var rcount=0;
  173. var regoffset=0;
  174. var regioarray=[];
  175. var noaccess=false;
  176. var c1=0;
  177. var c2=0;
  178. var c3=0;
  179. var c4=0;
  180. var c5=0;
  181. var c6=0;
  182. var c7=0;
  183. var c7a=100;
  184. var c8=0;
  185. var c10=0;
  186. var firstentry=true;
  187. var twaiting=false;
  188. var chatrules="";
  189. var roomstatus="";
  190. var oldroomstatus="";
  191. var alarmaudio = new Audio('https://web.static.mmcdn.com/tsdefaultassets/sounds/classic/huge.mp3');
  192. var alarmrun=false;
  193.  
  194. if (!readCookie("agreeterms")){
  195. createCookie("agreeterms","1");
  196. window.localStorage.clear();
  197. setTimeout(function(){
  198. window.location.reload(true);
  199. },100);
  200. }
  201. if (document.getElementsByClassName("dismiss_notice_tfa_and_email").length>0){
  202. document.getElementsByClassName("dismiss_notice_tfa_and_email")[0].click();
  203. }
  204. setgenstyle();
  205. getmessage();
  206. if (roomname=="my_collection"){
  207. if (document.getElementsByTagName("video").length>0){
  208. savedprvdownload();// >>>>>>>>>> end
  209. }
  210. return;
  211. }
  212. if (roomname=="photo_videos"){
  213. collectiondownload();// >>>>>>>>>>>>end
  214. return;
  215. }
  216. var supporter=true;
  217. var login=true;
  218. if (document.querySelector('[class="upgrade"]')){
  219. supporter=false;
  220. }
  221. if (document.querySelector('[href="/auth/login/"]')){
  222. supporter=false;
  223. login=false;
  224. }
  225. getsaving();
  226. refresher();
  227. if (roomname=="discover"){discoverpage=true;}
  228. if (roomname=="tags"){tagspage=true;}
  229. var siteversion=1;
  230. if ((document.getElementById("roomlist_root")!=null)&&(document.getElementById("TheaterModeRoomContents")!=null)){
  231. siteversion=2;
  232. }
  233. if (siteversion==2){
  234. getpage();
  235. }else{
  236. if (document.getElementById("roomlist_root")){thumbpage=true;}
  237. }
  238. function getpage(){
  239. if(!ppage){
  240. var tab=document.getElementsByClassName("gender-tab")[0].getElementsByTagName("a")[0];
  241. var tabclas = tab.classList;
  242. if (!tabclas.contains("activeRoom")){
  243. thumbpage=true;
  244. }
  245. }
  246. observer8.observe(document.getElementById("main"),observerConfig8);
  247. }
  248. function restart(){
  249. observer3.disconnect();
  250. cleanpage();
  251. thumbpage=false;
  252. getpage();
  253. if (thumbpage){
  254. dothumbpagethings();
  255. }else{
  256. test();
  257. }
  258. hidesw();
  259. }
  260. aff();
  261. noadd();
  262. moreoptions();
  263. if (document.querySelector('[data-testid="denied-notice"]')){
  264. bannedroom();
  265. return;
  266. }
  267. if (roomname=="roomlogin"){
  268. noaccess=true;
  269. roomname=currpage.split("/")[4];
  270. passwordfollow();
  271. return;
  272. }
  273. if (tagspage){setupfollowmove();}
  274. if (discoverpage){dothumbpagethings();}
  275. if (thumbpage){dothumbpagethings();}
  276. if (siteversion==1){
  277. if (document.getElementById('main')){
  278. test();
  279. }
  280. }
  281. if (siteversion==2){
  282. if (document.getElementById('main').classList.contains("roomPage")){
  283. test();
  284. }
  285. if (ppage){test();}
  286. }
  287. function test(){
  288. if(document.getElementsByClassName("BioContents").length>0){
  289. container=document.getElementsByClassName("BioContents")[0];
  290. n=0;
  291. setTimeout(function(){test2();}, 100);
  292. }else{
  293. n++;
  294. if (n==100){return;}
  295. setTimeout(function(){test();}, 100);
  296. }
  297. }
  298.  
  299. function test2(){
  300. if (n==100){return;}
  301. if (container.innerHTML.indexOf("Loading…")!=-1){
  302. n++;
  303. setTimeout(function(){test2();}, 100);
  304. }else{
  305. n=0;
  306. test3();
  307. }
  308. }
  309.  
  310. function test3(){
  311. n++;
  312. if (n==100){return;}
  313. setTimeout(function(){
  314. if (container.getElementsByTagName("table").length>0){
  315. if(!ppage){
  316. if (siteversion==2){
  317. observer7.observe(document.getElementsByClassName("activeRoom")[0],observerConfig7);
  318. }
  319. if (siteversion==1){
  320. observer7.observe(document.querySelector('[data-paction-name="ActiveRoom"]'),observerConfig7a);
  321. }
  322. }
  323. dobiothings();
  324. }else{
  325. test3();
  326. }
  327. }, 100);
  328. }
  329. function hidemtenter(){
  330. if (!localStorage.getItem("hidemt")){return;}
  331. var toptabs=document.getElementsByClassName("gender-tab");
  332. for (n=0; n<toptabs.length; n++){
  333. if (toptabs[n].href){
  334. toptabs[n].style.display="block";
  335. }
  336. }
  337. roomname=document.location.href.split("/")[3];
  338. if (roomname=="followed-cams"){return;}
  339. if ((roomname=="male-cams")||(roomname=="trans-cams")){
  340. document.location.href=domain;
  341. }
  342. for (n=0; n<toptabs.length; n++){
  343. if (toptabs[n].href){
  344. if (toptabs[n].href.indexOf("/male-")!=-1){
  345. toptabs[n].style.display="none";
  346. }
  347. if (toptabs[n].href.indexOf("/male/")!=-1){
  348. toptabs[n].style.display="none";
  349. }
  350. if (toptabs[n].href.indexOf("/trans-")!=-1){
  351. toptabs[n].style.display="none";
  352. }
  353. if (toptabs[n].href.indexOf("/trans/")!=-1){
  354. toptabs[n].style.display="none";
  355. }
  356. }
  357. }
  358. }
  359.  
  360. function nextcam(){
  361. if (siteversion==2){
  362. observer7.disconnect();
  363. if (document.getElementsByClassName("activeRoom").length==0){return;}
  364. roomname=document.getElementsByClassName("activeRoom")[0].innerHTML.split("'")[0].toLowerCase();
  365. container.getElementsByTagName("table")[0].remove();
  366. restart();
  367. }
  368. if (siteversion==1){
  369. observer7.disconnect();
  370. observer3.disconnect();
  371. cleanpage();
  372. roomname=document.querySelector('[data-paction-name="ActiveRoom"]').innerHTML.split("'")[0].toLowerCase();
  373. test();
  374. }
  375. }
  376.  
  377. function cleanpage(){
  378. if (document.getElementById("notepop")){
  379. document.getElementById("notepop").remove();
  380. }
  381. if (document.getElementById("vcontr")){
  382. document.getElementById("vcontr").remove();
  383. }
  384. if (document.getElementById("ccontr")){
  385. document.getElementById("ccontr").remove();
  386. }
  387. if (document.getElementById("clean")){
  388. document.getElementById("clean").remove();
  389. }
  390. if (document.getElementById("infore")){
  391. document.getElementById("infore").remove();
  392. }
  393. if (document.getElementById("controls")){
  394. document.getElementById("controls").remove();
  395. }
  396. if (document.getElementById("chatcontrols")){
  397. document.getElementById("chatcontrols").remove();
  398. }
  399. if (document.getElementById("rulespop")){
  400. document.getElementById("rulespop").remove();
  401. }
  402. }
  403.  
  404. function moreoptions(){
  405. if (roomname=="auth"){return;}
  406. var newelemsw=document.getElementById('UserMenuDropDown').firstChild.cloneNode(true);
  407. var newelemsw2=newelemsw.cloneNode(true);
  408. var newelemsw3=newelemsw.cloneNode(true);
  409. var newelemsw4=newelemsw.cloneNode(true);
  410. var newelemsw5=newelemsw.cloneNode(true);
  411. var newelemsw6=newelemsw.cloneNode(true);
  412. var newelemtxt=newelemsw.cloneNode(false);
  413. var newelemtxt2=newelemsw.cloneNode(false);
  414. var newelemtxt3=newelemsw.cloneNode(false);
  415. newelemtxt.innerHTML="Script settings:";
  416. newelemtxt.style.cursor="default";
  417. newelemtxt2.innerHTML="Save all settings.";
  418. newelemtxt2.id="saved";
  419. newelemtxt2.style.cursor="pointer";
  420. newelemtxt2.addEventListener("click", savesetting );
  421. newelemtxt3.innerHTML="Clear all saved settings.";
  422. newelemtxt3.id="clear";
  423. newelemtxt3.style.cursor="pointer";
  424. newelemtxt3.addEventListener("click", clearsettings );
  425. newelemsw.firstChild.data = "Thumbnail zoom off.";
  426. newelemsw.id="h1";
  427. newelemsw.getElementsByClassName("dmSwitchCircle")[0].id="a1";
  428. newelemsw.addEventListener("click", zoomoff );
  429. newelemsw2.firstChild.data = "Preview rooms off.";
  430. newelemsw2.id="h2";
  431. newelemsw2.getElementsByClassName("dmSwitchCircle")[0].id="a2";
  432. newelemsw2.addEventListener("click", anionoff );
  433. newelemsw3.firstChild.data = "Open rooms in new tab.";
  434. newelemsw3.getElementsByClassName("dmSwitchCircle")[0].id="a3";
  435. newelemsw3.addEventListener("click", newtabon );
  436. newelemsw4.firstChild.data = "Auto refresh followed off.";
  437. newelemsw4.id="h3";
  438. newelemsw4.getElementsByClassName("dmSwitchCircle")[0].id="a4";
  439. newelemsw4.addEventListener("click", refreshoff );
  440. newelemsw6.firstChild.data = "Big thumbnails.";
  441. newelemsw6.id="h4";
  442. newelemsw6.getElementsByClassName("dmSwitchCircle")[0].id="a6";
  443. newelemsw6.addEventListener("click", bigthumb );
  444. newelemsw5.firstChild.data = "Hide male/trans.";
  445. newelemsw5.getElementsByClassName("dmSwitchCircle")[0].id="a5";
  446. newelemsw5.addEventListener("click", hidemt );
  447. document.getElementById('UserMenuDropDown').appendChild(newelemtxt);
  448. document.getElementById('UserMenuDropDown').appendChild(newelemsw);
  449. document.getElementById('UserMenuDropDown').appendChild(newelemsw2);
  450. document.getElementById('UserMenuDropDown').appendChild(newelemsw3);
  451. document.getElementById('UserMenuDropDown').appendChild(newelemsw4);
  452. document.getElementById('UserMenuDropDown').appendChild(newelemsw6);
  453. document.getElementById('UserMenuDropDown').appendChild(newelemsw5);
  454. if (login){
  455. document.getElementById('UserMenuDropDown').appendChild(newelemtxt2);
  456. document.getElementById('UserMenuDropDown').appendChild(newelemtxt3);
  457. }
  458. hidesw();
  459. }
  460.  
  461. function hidesw(){
  462. document.getElementById("h1").style.display="block";
  463. document.getElementById("h2").style.display="block";
  464. document.getElementById("h3").style.display="block";
  465. document.getElementById("h4").style.display="block";
  466. if (discoverpage){document.getElementById("h1").style.display="none";}
  467. if (supporter){document.getElementById("h2").style.display="none";}
  468. if (!login){document.getElementById("h3").style.display="none";}
  469. if (!thumbpage){document.getElementById("h4").style.display="none";}
  470. setsw();
  471. }
  472.  
  473. function setsw(){
  474. if (localStorage.getItem("bigthumb")){
  475. document.getElementById("a6").style.left="25px";
  476. }else{
  477. document.getElementById("a6").style.left="3px";
  478. }
  479. if (localStorage.getItem("hidemt")){
  480. document.getElementById("a5").style.left="25px";
  481. }else{
  482. document.getElementById("a5").style.left="3px";
  483. }
  484. if (localStorage.getItem("refreshoff")){
  485. document.getElementById("a4").style.left="25px";
  486. }else{
  487. document.getElementById("a4").style.left="3px";
  488. }
  489. if (localStorage.getItem("newtabon")){
  490. document.getElementById("a3").style.left="25px";
  491. }else{
  492. document.getElementById("a3").style.left="3px";
  493. }
  494. if (localStorage.getItem("animationoff")){
  495. document.getElementById("a2").style.left="25px";
  496. }else{
  497. document.getElementById("a2").style.left="3px";
  498. }
  499. if (localStorage.getItem("zoomoff")){
  500. document.getElementById("a1").style.left="25px";
  501. }else{
  502. document.getElementById("a1").style.left="3px";
  503. }
  504. if (roomname!="discover"){
  505. document.body.classList.add("thumbpage");
  506. setclass();
  507. }
  508. }
  509. function setclass(){
  510. document.body.classList.remove("zoom");
  511. document.body.classList.remove("bigzoom");
  512. document.body.classList.remove("bigThumb");
  513. if(localStorage.getItem("bigthumb")){
  514. document.body.classList.add("bigThumb");
  515. }
  516. if(!localStorage.getItem("zoomoff")){
  517. if(document.getElementById("main").classList.contains("roomPage")){
  518. document.body.classList.add("zoom");
  519. return;
  520. }
  521. if(localStorage.getItem("bigthumb")){
  522. document.body.classList.add("bigzoom");
  523. }else{
  524. document.body.classList.add("zoom");
  525. }
  526. }
  527. }
  528.  
  529. function bigthumb(){
  530. if (document.getElementById("a6").style.left=="3px"){
  531. document.getElementById("a6").style.left="25px";
  532. localStorage.setItem("bigthumb","foo");
  533. }else{
  534. document.getElementById("a6").style.left="3px";
  535. localStorage.removeItem("bigthumb");
  536. }
  537. setclass();
  538. }
  539. function zoomoff(){
  540. if (document.getElementById("a1").style.left=="3px"){
  541. document.getElementById("a1").style.left="25px";
  542. localStorage.setItem("zoomoff","foo");
  543. }else{
  544. document.getElementById("a1").style.left="3px";
  545. localStorage.removeItem("zoomoff");
  546. }
  547. setclass();
  548. }
  549. function hidemt(){
  550. if (document.getElementById("a5").style.left=="3px"){
  551. document.getElementById("a5").style.left="25px";
  552. localStorage.setItem("hidemt","foo");
  553. }else{
  554. document.getElementById("a5").style.left="3px";
  555. localStorage.removeItem("hidemt");
  556. }
  557. }
  558. function refreshoff(){
  559. if (document.getElementById("a4").style.left=="3px"){
  560. document.getElementById("a4").style.left="25px";
  561. localStorage.setItem("refreshoff","foo");
  562. }else{
  563. document.getElementById("a4").style.left="3px";
  564. localStorage.removeItem("refreshoff");
  565. }
  566. }
  567. function newtabon(){
  568. if (document.getElementById("a3").style.left=="3px"){
  569. document.getElementById("a3").style.left="25px";
  570. localStorage.setItem("newtabon","foo");
  571. }else{
  572. document.getElementById("a3").style.left="3px";
  573. localStorage.removeItem("newtabon");
  574. }
  575. }
  576. function anionoff(){
  577. if (document.getElementById("a2").style.left=="3px"){
  578. document.getElementById("a2").style.left="25px" ;
  579. localStorage.setItem("animationoff","foo");
  580. }else{
  581. document.getElementById("a2").style.left="3px";
  582. localStorage.removeItem("animationoff");
  583. }
  584. }
  585.  
  586. function savesetting(){
  587. document.getElementById("saved").removeEventListener("click", savesetting );
  588. var theme_name="lightmode";
  589. if (readCookie("theme_name")){
  590. theme_name=readCookie("theme_name");
  591. }
  592. var bigthumb=0;
  593. if (localStorage.getItem("bigthumb")){
  594. bigthumb=1;
  595. }
  596. var hidemt=0;
  597. if (localStorage.getItem("hidemt")){
  598. hidemt=1;
  599. }
  600. var newtabon=0;
  601. if (localStorage.getItem("newtabon")){
  602. newtabon=1;
  603. }
  604. var refreshoff=0;
  605. if (localStorage.getItem("refreshoff")){
  606. refreshoff=1;
  607. }
  608. var zoomoff=0;
  609. if (localStorage.getItem("zoomoff")){
  610. zoomoff=1;
  611. }
  612. var animationoff=0;
  613. if (localStorage.getItem("animationoff")){
  614. animationoff=1;
  615. }
  616. var cleanprof=0;
  617. if (localStorage.getItem("pclean")){
  618. cleanprof=1;
  619. }
  620. var isTheaterMode=localStorage.getItem("isTheaterMode");
  621. var defaultVideoWidth =localStorage.getItem("defaultVideoWidth");
  622. var videoControls =localStorage.getItem("videoControls");
  623. var hpfltopen=localStorage.getItem("hpfltopen");
  624. var allstring="good boy#refreshoff#"+refreshoff+"#bigthumb#"+bigthumb+"#hidemt#"+hidemt+"#newtabon#"+newtabon+"#zoomoff#"+zoomoff+"#animationoff#"+animationoff+"#cleanprof#"+cleanprof+"#isTheaterMode#"+isTheaterMode+"#defaultVideoWidth#"+defaultVideoWidth+"#videoControls#"+videoControls+"#theme_name#"+theme_name+"#hpfltopen#"+hpfltopen;
  625. var url=domain+"api/notes/for_user/"+stor+"/";
  626. var csrftoken= readCookie("csrftoken");
  627. var data = new FormData();
  628. data.append( "text", allstring );
  629. fetch(url,
  630. {
  631. method: "POST",
  632. headers: {
  633. 'x-csrftoken': csrftoken,
  634. 'x-requested-with': 'XMLHttpRequest'
  635. },
  636. body: data
  637. }).then(function(){document.getElementById("saved").innerHTML="Settings saved";setTimeout(function(){document.getElementById("saved").innerHTML="Save all settings.";document.getElementById("saved").addEventListener("click", savesetting );},2000);});
  638. }
  639.  
  640. function clearsettings(){
  641. document.getElementById("clear").removeEventListener("click", clearsettings );
  642. var url=domain+"api/notes/for_user/"+stor+"/";
  643. var csrftoken= readCookie("csrftoken");
  644. var data = new FormData();
  645. data.append( "text", "" );
  646. fetch(url,
  647. {
  648. method: "POST",
  649. headers: {
  650. 'x-csrftoken': csrftoken,
  651. 'x-requested-with': 'XMLHttpRequest'
  652. },
  653. body: data
  654. }).then(function(){document.getElementById("clear").innerHTML="Saved settings removed.";setTimeout(function(){document.getElementById("clear").innerHTML="Clear all saved settings.";document.getElementById("clear").addEventListener("click", clearsettings );},2000);});
  655. }
  656.  
  657. function getsaving(){
  658. if (!login){
  659. localStorage.removeItem("login");
  660. return;
  661. }else{
  662. if (localStorage.getItem("login")){
  663. return;
  664. }
  665. }
  666. localStorage.setItem("login","foo");
  667. var url=domain+"api/notes/for_user/"+stor+"/";
  668. fetch(url,{ credentials: "same-origin"}).then(
  669. function(response) {
  670. if (response.status !== 200) {
  671. return;
  672. }
  673. response.json().then(function(data) {
  674. if (data.text == null){return;}
  675. restoresettings(data.text);
  676. });
  677. });
  678. }
  679.  
  680. function restoresettings(data){
  681. if (data.indexOf("good boy")!=0){return;}
  682. if (data.indexOf("refreshoff#")!=-1){
  683. var refreshoff=data.split("refreshoff#")[1].split("#")[0];
  684. localStorage.setItem("refreshoff","foo");
  685. if (refreshoff==0){localStorage.removeItem("refreshoff");}
  686. }
  687. if (data.indexOf("newtabon#")!=-1){
  688. var newtabon=data.split("newtabon#")[1].split("#")[0];
  689. localStorage.setItem("newtabon","foo");
  690. if (newtabon==0){localStorage.removeItem("newtabon");}
  691. }
  692. if (data.indexOf("hidemt#")!=-1){
  693. var hidemt=data.split("hidemt#")[1].split("#")[0];
  694. localStorage.setItem("hidemt","foo");
  695. if (hidemt==0){localStorage.removeItem("hidemt");}
  696. }
  697. if (data.indexOf("bigthumb#")!=-1){
  698. var bigthumb=data.split("bigthumb#")[1].split("#")[0];
  699. localStorage.setItem("bigthumb","foo");
  700. if (bigthumb==0){localStorage.removeItem("bigthumb");}
  701. }
  702. if (data.indexOf("zoomoff#")!=-1){
  703. var zoomoff=data.split("zoomoff#")[1].split("#")[0];
  704. localStorage.setItem("zoomoff","foo");
  705. if (zoomoff==0){localStorage.removeItem("zoomoff");}
  706. }
  707. if (data.indexOf("animationoff#")!=-1){
  708. var animationoff=data.split("animationoff#")[1].split("#")[0];
  709. localStorage.setItem("animationoff","foo");
  710. if (animationoff==0){localStorage.removeItem("animationoff");}
  711. }
  712. if (data.indexOf("cleanprof#")!=-1){
  713. var cleanprof=data.split("cleanprof#")[1].split("#")[0];
  714. localStorage.setItem("pclean","foo");
  715. if (cleanprof==0){localStorage.removeItem("pclean");}
  716. }
  717. if (data.indexOf("isTheaterMode#")!=-1){
  718. var isTheaterMode=data.split("isTheaterMode#")[1].split("#")[0];
  719. localStorage.setItem("isTheaterMode",isTheaterMode);
  720. }
  721. if (data.indexOf("defaultVideoWidth#")!=-1){
  722. var defaultVideoWidth=data.split("defaultVideoWidth#")[1].split("#")[0];
  723. localStorage.setItem("defaultVideoWidth",defaultVideoWidth);
  724. }
  725. if (data.indexOf("videoControls#")!=-1){
  726. var videoControls=data.split("videoControls#")[1].split("#")[0];
  727. if (!jsontest(videoControls)){videoControls='{"volume":60,"isMuted":false}';}
  728. localStorage.setItem("videoControls",videoControls);
  729. }
  730. var exp=new Date().getTime()+86400000;
  731. if (data.indexOf("hpfltopen#")!=-1){
  732. var hpfltopen=data.split("hpfltopen#")[1].split("#")[0];
  733. hpfltopen=hpfltopen.split('expiration":')[0]+'expiration":'+exp+'}';
  734. localStorage.setItem("hpfltopen",hpfltopen);
  735. }
  736. if (data.indexOf("theme_name#")!=-1){
  737. var theme_name=data.split("theme_name#")[1].split("#")[0];
  738. createCookie("theme_name",theme_name);
  739. }
  740. document.location.reload();
  741. }
  742. function jsontest(jsonstr){
  743. try {
  744. JSON.parse(jsonstr);
  745. return true;
  746. } catch(e) {
  747. return false;
  748. }
  749. }
  750.  
  751. function dobiothings(){
  752. hidemtenter();
  753. if(ppage){
  754. if (currpage.split("model=").length==1){return;}
  755. roomname=currpage.split("model=")[1].split("&")[0];
  756. if (roomname==yourname){return;}
  757. rebuildbio();
  758. }else{
  759. afterrebuild();
  760. }
  761. }
  762.  
  763. function afterrebuild(){
  764. bio=true;
  765. if((ppage)||(!login)){
  766. document.querySelector('[data-testid="bio-header"]').innerHTML="<a href='"+domain+roomname+"?tab=bio' id=biotop>"+roomname.charAt(0).toUpperCase()+roomname.slice(1)+"'s Bio (Go to the cam page)</a>";
  767. }else{
  768. document.querySelector('[data-testid="bio-header"]').innerHTML="<a href='"+domain+"p/"+yourname+"?tab=bio&model="+roomname+"' id=biotop>"+roomname.charAt(0).toUpperCase()+roomname.slice(1)+"'s Bio and Free Webcam (Go to the bio)</a>";
  769. }
  770. document.getElementById("biotop").addEventListener("click", function(event){window.location.replace(this.href);event.stopPropagation();event.preventDefault();return false;});
  771. makevidcontrol();
  772. cleaninit();
  773. linkfix();
  774. info(true);
  775. buildnotepop();
  776. getnoteslist();
  777. if (document.getElementsByTagName("video").length>0){
  778. getvid();
  779. vreset();
  780. iagree();
  781. }
  782. }
  783.  
  784. function dothumbpagethings(){
  785. buildnotepop();
  786. getnoteslist();
  787. return;
  788. }
  789.  
  790. function iagree(){
  791. triggerMouseEvent (document.getElementsByClassName("inputDiv")[0], "mousedown");
  792. if (document.getElementsByClassName("acceptRulesButton").length>0){
  793. document.getElementsByClassName("acceptRulesButton")[0].click();
  794. }
  795. if (document.querySelector('[data-testid="dismissible-message-dismiss"]')){
  796. document.querySelector('[data-testid="dismissible-message-dismiss"]').click();
  797. }
  798. }
  799.  
  800. function triggerMouseEvent (node, eventType) {
  801. var clickEvent = new Event(eventType, { bubbles: true, cancelable: true });
  802. node.dispatchEvent (clickEvent);
  803. }
  804.  
  805. function setgenstyle(){
  806. var style = document.createElement('style');
  807. style.setAttribute('type', 'text/css');
  808. style.textContent = ".userUpload img{display:none}"+
  809. ".lockOverlayBg {background-color:rgba(0, 0, 0, 0) !important;top:50% !important}"+
  810. ".lockOverlayBg img{display:none}"+
  811. ".userUpload div{background-color:rgba(0, 0, 0, 0) !important}"+
  812. ".previewBorder {display:block !important}"+
  813. ".previewText {color:black !important}"+
  814. ".photoVideoDetailSection img{filter: blur(0px) !important;height:auto !important;width:auto !important; margin-left: auto;margin-right: auto;display:block;min-width:50%;min-height:50%;max-width:100%;max-height:100%}"+
  815. ".BioContents{position:relative !important}"+
  816. ".bioContentText div{background-color:rgba(0, 0, 0, 0) !important}"+
  817. ".theme-external select{background-color: #dde9f5 !important; color:#5e81a4 !important; border-color:#8bb3da !important}"+
  818. ".profplayer{z-index:99;position:absolute;top:10px;right:10px;border:1px solid rgb(221, 221, 221);border-radius:4px;box-shadow:0px 0px 32px rgba(0, 0, 0, 0.32)}"+
  819. ".darkmode .profplayer{z-index:99;position:absolute;top:10px;right:10px;border:1px solid rgb(29, 29, 29);border-radius:4px;box-shadow:0px 0px 32px rgba(255, 255, 255, 0.22)}"+
  820. ".profdivplayer{z-index:99;position:absolute;top:10px;right:10px;overflow:hidden;resize:horizontal;direction:rtl;border:1px solid rgb(221, 221, 221);border-radius:4px;box-shadow:0px 0px 32px rgba(0, 0, 0, 0.32);background-color:rgba(0, 0, 0, 0.32)}"+
  821. ".darkmode .profdivplayer{z-index:99;position:absolute;top:10px;right:10px;overflow:hidden;resize:horizontal;direction:rtl;border:1px solid rgb(29, 29, 29);border-radius:4px;box-shadow:0px 0px 32px rgba(255, 255, 255, 0.22);background-color:rgba(255, 255, 255, 0.22)}"+
  822. ".darkmode select{background-color: #202c39 !important; color:#b3b3b3 !important; border-color:#2d3e50 !important}"+
  823. ".tinput {background-color: #dde9f5 !important; color:#5e81a4 !important; border-color:#8bb3da !important}"+
  824. ".darkmode .tinput {background-color: #202c39 !important; color:#b3b3b3 !important; border-color:#2d3e50 !important}"+
  825. "#proftext {width: 200px; height: 45px; line-height: 14px; border-width: 1px; border-style: solid; border-color: #acacac; border-radius: 4px; padding: 7px 8px; overflow: auto;background-color: rgb(230, 230, 230);color:#000;min-width:200px;min-height:45px}"+
  826. ".darkmode #proftext{width: 200px; height: 45px; line-height: 14px; border-width: 1px; border-style: solid; border-color: #2d3e50; border-radius: 4px; padding: 7px 8px; overflow: auto;background-color: rgb(20,20,20);color:#fff;min-width:200px;min-height:45px}"+
  827. ".cbLogo {display:none !important}"+
  828. ".translated {background-color:#FFFFE0;color:red;margin-left:10px;padding:0px 5px 0px 5px;text-shadow:0px 0px !important}"+
  829. ".darkmode .translated {background-color:#000020;color:red;margin-left:10px;padding:0px 5px 0px 5px;text-shadow:0px 0px !important}"+
  830. ".popclass {background-color:rgb(255, 255, 211)}"+
  831. ".darkmode .popclass {background-color:rgb(30, 30, 10)}"+
  832. ".ad {padding: 0px;overflow:hidden; font-weight: bold;color:white;border-radius:5px}"+
  833. ".adinfo {position: relative; display: flex; height: 100%; width: 940px; right:0px}"+
  834. ".adinfo {transition: 1.0s ease-in-out}"+
  835. ".adinfo:hover {right: 472px }"+
  836. ".adscriptinfo {display:block;height:100%;width:468px}"+
  837. ".bigThumb ul.list{grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)) !important}"+
  838. ".roomCard {transition: .5s}"+
  839. ".roomCard:hover {border-color:red;z-index:20}"+
  840. ".thumbpage .content{overflow: visible; !important ;margin-right:33px !important;margin-left:33px !important}"+
  841. ".followedDropdown{z-index:50 !important}"+
  842. ".list{overflow: visible !important}"+
  843. ".MoreRooms{overflow: visible !important}"+
  844. ".zoom .roomCard:hover {transform: scale(1.37)}"+
  845. ".bigzoom .roomCard:hover {transform: scale(1.23)}";
  846. document.getElementsByTagName('head')[0].appendChild(style);
  847. }
  848.  
  849. function getnoteslist(){
  850. if(!login){usernoteslist="";whatpage();return;}
  851. var url=domain+"api/notes/usernames/";
  852. fetch(url,{ credentials: "same-origin"}).then(
  853. function(response) {
  854. if (response.status !== 200){
  855. return;
  856. }
  857. response.json().then(function(data) {
  858. usernoteslist=data;
  859. }).then(whatpage);
  860. });
  861. }
  862.  
  863. function whatpage(){
  864. setupfollowmove();
  865. if (thumbpage){setupmove();}
  866. if (bio){setupbiomove();}
  867. if (discoverpage){
  868. setInterval(addevent2,5000);
  869. }
  870. }
  871.  
  872. function setupfollowmove(){
  873. var observenode=document.getElementsByClassName("followedDropdown")[0];
  874. observer6.observe(observenode,observerConfig6);
  875. }
  876.  
  877. function adjustfollowhumbs(){
  878. if (document.getElementsByClassName("followedDropdown")[0].style.display!="block"){return;}
  879. addevent2();
  880. }
  881.  
  882. function setupmove(){
  883. var observenode=document.getElementsByClassName("list")[0];
  884. observer4.observe(observenode,observerConfig4);
  885. adjusthumbs();
  886. addevent2();
  887. }
  888.  
  889. function adjusthumbs(){
  890. subsel();
  891. if (document.getElementsByClassName("list")[0].classList.contains("loading")){return;}
  892. document.getElementById("notepop").style.display="none";
  893. if (document.getElementsByClassName("list").length>1){
  894. var observenode=document.getElementsByClassName("list")[1];
  895. observer41.observe(observenode,observerConfig4);
  896. setTimeout(addevent2, 1000);
  897. }else{
  898. addevent2();
  899. }
  900. }
  901.  
  902. function setupbiomove(){
  903. if (ppage){return;}
  904. var observenode=document.querySelector('[data-testid="more-rooms-like-this-tab-contents"]').firstChild;
  905. observer5.observe(observenode,observerConfig5);
  906. addevent2();
  907. }
  908.  
  909. function adjustbiohumbs(){
  910. if (ppage){return;}
  911. if(document.querySelector('[data-testid="more-rooms-like-this-tab-contents"]').firstChild.style.display=="block"){return;}
  912. addevent2();
  913. }
  914.  
  915. function addevent2(){
  916. hidemtenter();
  917. var hidrooms=0;
  918. if (currpage!=document.location.href){
  919. document.getElementById("notepop").style.display="none";
  920. }
  921. currpage=document.location.href;
  922. var genclass="";
  923. var tags=document.querySelectorAll('[data-testid="room-card-image"]');
  924. for (n=0; n<tags.length; n++){
  925. if ((localStorage.getItem("hidemt"))&&(roomname!="followed-cams")){
  926. if(tags[n].parentNode.parentNode.querySelector('[data-testid="room-card-gender"]')){
  927. genclass=tags[n].parentNode.parentNode.querySelector('[data-testid="room-card-gender"]').classList;
  928. if ((genclass.contains("genderm"))||(genclass.contains("genders"))){
  929. tags[n].parentNode.parentNode.style.display="none";
  930. hidrooms++;
  931. }
  932. }
  933. }
  934. if(!tags[n].name){
  935. tags[n].name="Camslut";
  936. tags[n].parentNode.href=tags[n].parentNode.href+"?tab=bio";
  937. tags[n].parentNode.addEventListener("click", function(event){event.stopPropagation();event.preventDefault();return false;});
  938. tags[n].addEventListener("click", function(event){var target="_self";if (localStorage.getItem("newtabon")){target="_blank";}window.open(this.parentNode.href, target);event.stopPropagation();event.preventDefault();return false;});
  939. if (!supporter){
  940. tags[n].parentNode.parentNode.addEventListener("mouseenter", moveimg);
  941. tags[n].parentNode.parentNode.addEventListener("mouseleave", moveimgstop);
  942. }
  943. var name=tags[n].parentNode.parentNode.querySelector('[data-testid="room-card-username"]');
  944. var thumbroomname=name.innerHTML;
  945. if (loggedin){
  946. name.href=domain+"p/"+yourname+"/?tab=bio&model="+thumbroomname;
  947. }
  948. name.addEventListener("click", function(event){var target="_self";if (localStorage.getItem("newtabon")){target="_blank";}window.open(this.href, target);event.stopPropagation();event.preventDefault();return false;});
  949. if (usernoteslist!=""){
  950. if (tags[n].parentNode.parentNode.className=="roomCard camBgColor"){
  951. var newelem=document.createElement('div');
  952. if (usernoteslist.usernames.indexOf(thumbroomname)!=-1){
  953. newelem.innerHTML=note;
  954. }else{
  955. newelem.innerHTML=nonote;
  956. }
  957. newelem.style.position="absolute";
  958. newelem.style.top="0px";
  959. newelem.style.left="0px";
  960. newelem.addEventListener("click", shownote );
  961. newelem.style.cursor="pointer";
  962. newelem.setAttribute("name", thumbroomname);
  963. newelem.name=thumbroomname;
  964. newelem.title="User notes";
  965. tags[n].parentNode.parentNode.appendChild(newelem);
  966. }
  967. }
  968. }
  969. }
  970. var mymsgline=0;
  971. if (document.location.href.split("/")[3]=="spy-on-cams"){
  972. mymsgline=1;
  973. }
  974. var msglines=document.querySelectorAll('[data-testid="num-of-rooms-msg"]');
  975. var msglinesleng=msglines.length;
  976. if (msglinesleng !=0){
  977. msglines[0].style.display="block";
  978. if (mymsgline == 1){
  979. msglines[1].style.display="block";
  980. }
  981. if (localStorage.getItem("hidemt")){
  982. var msg=msglines[mymsgline].innerHTML.split("filters")[0]+"filters";
  983. msglines[mymsgline].innerHTML=msg+". "+hidrooms+" on this page are hidden.";
  984. }
  985. }
  986. hidrooms=0;
  987. showhidden();
  988. }
  989.  
  990. function showhidden(){
  991. if (document.location.href.split("/")[3]=="spy-on-cams"){showhidden4();return;}
  992. if (document.location.href.split("/")[3]!="followed-cams"){return;}
  993. if (document.location.href.split("/")[4]=="offline"){return;}
  994. if (!document.querySelector('[data-testid="room-card-image"]')){return;}
  995. if (document.querySelector('[data-testid="room-card-image"]').name=="hid"){return;}
  996. document.querySelector('[data-testid="room-card-image"]').name="hid";
  997. hidoffset=0;
  998. hiddenarray=[];
  999. showhidden2();
  1000. }
  1001.  
  1002. function showhidden2(){
  1003. if (hprom){return;}
  1004. hprom=true;
  1005. var url=hidurl+hidoffset*90;
  1006. fetch(url,{ credentials: "same-origin"}).then(
  1007. function(response) {
  1008. if (response.status !== 200) {
  1009. hprom=false;
  1010. return;
  1011. }
  1012. response.json().then(function(data){
  1013. if (data.rooms != null){
  1014. var hiddenlist=data.rooms;
  1015. for (n=0; n<hiddenlist.length; n++){
  1016. hiddenarray.push(hiddenlist[n].username);
  1017. }
  1018. var pages=Math.ceil(data.total_count/90);
  1019. hidoffset++;
  1020. if (hidoffset!=pages){
  1021. hprom=false;
  1022. showhidden2();
  1023. }else{
  1024. hprom=false;
  1025. showhidden3();
  1026. }
  1027. }
  1028. });
  1029. });
  1030. }
  1031.  
  1032. function showhidden3(){
  1033. var tags=document.querySelector('[data-testid="room-list-container"]').querySelectorAll('[data-testid="room-card"]');
  1034. for (n=0; n<tags.length; n++){
  1035. var name=tags[n].querySelector('[data-testid="room-card-username"]').innerHTML;
  1036. if (hiddenarray.indexOf(name)!=-1){
  1037. tags[n].querySelector('[data-testid="thumbnail-label"]').innerHTML=tags[n].querySelector('[data-testid="thumbnail-label"]').innerHTML+" HIDDEN ";
  1038. tags[n].querySelector('[data-testid="thumbnail-label"]').style.backgroundColor = "blue";
  1039. }
  1040. }
  1041. }
  1042.  
  1043. function showhidden4(){
  1044. if (document.querySelectorAll('[data-testid="room-list-container"]')[1].querySelector('[data-testid="room-card-image"]').name=="hid"){return;}
  1045. document.querySelectorAll('[data-testid="room-list-container"]')[1].querySelector('[data-testid="room-card-image"]').name="hid";
  1046. var tags=document.querySelectorAll('[data-testid="room-list-container"]')[1].querySelectorAll('[data-testid="room-card"]');
  1047. for (n=0; n<tags.length; n++){
  1048. tags[n].querySelector('[data-testid="thumbnail-label"]').innerHTML=tags[n].querySelector('[data-testid="thumbnail-label"]').innerHTML+" HIDDEN ";
  1049. tags[n].querySelector('[data-testid="thumbnail-label"]').style.backgroundColor = "blue";
  1050. }
  1051. }
  1052.  
  1053. function shownote(e){
  1054. if(( document.getElementById("notepop").style.display=="block")&&(openthumbname==this.name)){
  1055. document.getElementById("notepop").style.display="none";
  1056. openthumbname="";
  1057. return;
  1058. }
  1059. document.getElementById("notepop").style.height="170px";
  1060. document.getElementById("notearea").value="";
  1061. document.getElementById("notenote").innerHTML=notegrey + " Note";
  1062. opennote="";
  1063. openthumbname=this.name;
  1064. var xpos=e.pageX;
  1065. document.getElementById("notearea").innerHTML="";
  1066. document.getElementById("notepop").style.top=e.pageY+100+"px";
  1067. document.getElementById("notepop").style.left=xpos+20+"px";
  1068. document.getElementById("notepop").style.display="block";
  1069. document.getElementById("notepopName").innerHTML=openthumbname;
  1070. var url=domain+"api/notes/for_user/"+openthumbname+"/";
  1071. fetch(url,{ credentials: "same-origin"}).then(
  1072. function(response) {
  1073. if (response.status !== 200) {
  1074. return;
  1075. }
  1076. response.json().then(function(data){
  1077. if (data.text != null){
  1078. document.getElementById("notearea").value=data.text;
  1079. opennote=data.text;
  1080. if (usernoteslist.usernames.indexOf(openthumbname)==-1){
  1081. usernoteslist.usernames.push(openthumbname);
  1082. updatedm2();
  1083. }
  1084. }
  1085. });
  1086. });
  1087. }
  1088.  
  1089. function buildnotepop(){
  1090. var newelem=document.createElement('span');
  1091. newelem.id="notepop";
  1092. newelem.style.display="none";
  1093. newelem.style.position="absolute";
  1094. newelem.style.overflow="hidden";
  1095. newelem.style.backgroundColor="rgb(255, 255, 255)";
  1096. newelem.style.border="1px solid rgb(221, 221, 221)";
  1097. newelem.style.borderRadius="4px";
  1098. newelem.style.width="188px";
  1099. newelem.style.height="170px";
  1100. newelem.style.zIndex="999";
  1101. newelem.style.boxShadow="0px 0px 32px rgba(0, 0, 0, 0.32)";
  1102. document.getElementById("footer-holder").appendChild(newelem);
  1103.  
  1104. newelem=document.createElement('div');
  1105. newelem.style.backgroundColor = "#dddddd";
  1106. newelem.style.color="grey";
  1107. newelem.style.fontWeight="bold";
  1108. newelem.style.height="15px";
  1109. newelem.style.fontSize="15px";
  1110. newelem.style.padding="8px";
  1111. newelem.style.textAlign="left";
  1112. newelem.innerHTML='<span id="notepopName" style="text-Overflow: ellipsis; overflow:hidden; width:150px; height:20px; display:inline-block" ></span><span><img src="https://web.static.mmcdn.com/tsdefaultassets/close-gray.svg" style="position: absolute; height: 13px; width: 13px; right: 8px;" title="Close" id="noteclose"></span>';
  1113. document.getElementById("notepop").appendChild(newelem);
  1114.  
  1115. document.getElementById("noteclose").addEventListener("click", notepopclose);
  1116.  
  1117. newelem=document.createElement('div');
  1118. newelem.style.backgroundColor = "white";
  1119. newelem.style.border="1px solid rgb(221, 221, 221)";
  1120. newelem.style.color="grey";
  1121. newelem.style.height="15px";
  1122. newelem.style.fontSize="12px";
  1123. newelem.style.padding="8px";
  1124. newelem.style.textAlign="left";
  1125. newelem.style.cursor="pointer";
  1126. newelem.addEventListener("click", function(){opendm2(document.getElementById("notepopName").innerHTML);});
  1127. newelem.id="notepopLink";
  1128. newelem.innerHTML='<img src="https://web.static.mmcdn.com/tsdefaultassets/popout-grey-d.svg" height="12px" width="12px"> Popout in new window';
  1129. document.getElementById("notepop").appendChild(newelem);
  1130.  
  1131. newelem=document.createElement('div');
  1132. newelem.style.backgroundColor = "white";
  1133. newelem.style.color="grey";
  1134. newelem.style.height="10px";
  1135. newelem.style.fontSize="12px";
  1136. newelem.style.padding="8px";
  1137. newelem.style.textAlign="left";
  1138. newelem.id="notenote";
  1139. newelem.innerHTML=notegrey + " Note";
  1140. document.getElementById("notepop").appendChild(newelem);
  1141.  
  1142. newelem=document.createElement('textarea');
  1143. newelem.id="notearea";
  1144. newelem.style.height="60px";
  1145. newelem.style.fontSize="12px";
  1146. newelem.style.border="1px solid rgb(172, 172, 172)";
  1147. newelem.style.borderRadius="4px";
  1148. newelem.style.backgroundColor="rgb(255, 255, 255)";
  1149. newelem.style.resize="none";
  1150. newelem.style.padding="5px";
  1151. newelem.style.width="85%";
  1152. newelem.setAttribute("placeholder", "Enter notes about this user (only seen by you)");
  1153. newelem.setAttribute("spellcheck", false);
  1154. newelem.addEventListener("input",openbutton);
  1155. newelem.id="notearea";
  1156. document.getElementById("notepop").appendChild(newelem);
  1157.  
  1158. newelem=document.createElement('div');
  1159. newelem.id="notecancelsubmit";
  1160. document.getElementById("notepop").appendChild(newelem);
  1161.  
  1162. newelem=document.createElement("span");
  1163. newelem.style.position="relative";
  1164. newelem.style.top="12px";
  1165. newelem.style.left="-15px";
  1166. newelem.addEventListener("click",closebutton);
  1167. newelem.innerHTML='<a href="#" >Cancel</a>';
  1168. document.getElementById("notecancelsubmit").appendChild(newelem);
  1169.  
  1170. var subbutstyle="color: rgb(255, 255, 255); background: rgba(0, 0, 0, 0) linear-gradient(rgb(255, 151, 53) 0%, rgb(255, 158, 54) 50%, rgb(255, 112, 2) 60%) repeat scroll 0% 0%; font-family: UbuntuMedium, Helvetica, Arial, sans-serif; font-size: 12px; padding: 4px 10px 5px; position: relative; right: 40px; top:10px; float: right; border-radius: 4px; cursor: pointer;";
  1171.  
  1172. newelem=document.createElement("span");
  1173. newelem.setAttribute("style", subbutstyle);
  1174. newelem.addEventListener("click",savenote);
  1175. newelem.innerHTML="Save";
  1176. document.getElementById("notecancelsubmit").appendChild(newelem);
  1177. }
  1178.  
  1179. function savenote(){
  1180. var notetext=document.getElementById("notearea").value;
  1181. var url=domain+"api/notes/for_user/"+openthumbname+"/";
  1182. var csrftoken= readCookie("csrftoken");
  1183. var data = new FormData();
  1184. data.append( "text", notetext );
  1185. fetch(url,
  1186. {
  1187. method: "POST",
  1188. headers: {
  1189. 'x-csrftoken': csrftoken,
  1190. 'x-requested-with': 'XMLHttpRequest'
  1191. },
  1192. body: data
  1193. }).then(aftersave);
  1194. }
  1195.  
  1196. function aftersave(){
  1197. var notetext=document.getElementById("notearea").value;
  1198. var doupdate=false;
  1199. if ((opennote=="")||(notetext=="")){
  1200. doupdate=true;
  1201. }
  1202. opennote=notetext;
  1203. closebutton();
  1204. if (doupdate){updatedm();}
  1205. }
  1206.  
  1207. function notepopclose(){
  1208. document.getElementById("notepop").style.display="none";
  1209. }
  1210. function openbutton(){
  1211. document.getElementById("notepop").style.height="215px";
  1212. document.getElementById("notenote").innerHTML=notegrey + " Note (unsaved)";
  1213. document.getElementById("notearea").value=document.getElementById("notearea").value.replace("$"," "+new Date().toLocaleDateString()+" ");
  1214. if(opennote==document.getElementById("notearea").value){
  1215. closebutton();
  1216. }
  1217. }
  1218. function closebutton(){
  1219. document.getElementById("notenote").innerHTML=notegrey + " Note";
  1220. document.getElementById("notepop").style.height="170px";
  1221. document.getElementById("notearea").value=opennote;
  1222. }
  1223.  
  1224. function opendm2(that){
  1225. var url=domain+"dm/"+that;
  1226. var dmwindow=window.open(url,that,'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=800');
  1227. dmwindow.onload = function(){
  1228. this.addEventListener('unload', function(){setTimeout(function(){updatedm();},1000);});
  1229. };
  1230. }
  1231.  
  1232. function updatedm(){
  1233. var url=domain+"api/notes/usernames/";
  1234. fetch(url,{ credentials: "same-origin"}).then(
  1235. function(response) {
  1236. if (response.status !== 200){
  1237. return;
  1238. }
  1239. response.json().then(function(data) {
  1240. usernoteslist=data;
  1241. }).then(updatedm2);
  1242. });
  1243. }
  1244.  
  1245. function updatedm2(){
  1246. var tags=document.querySelectorAll('[title="User notes"]');
  1247. for (n=0; n<tags.length; n++){
  1248. if (usernoteslist.usernames.indexOf(tags[n].getAttribute("name"))!=-1){
  1249. tags[n].innerHTML=note;
  1250. }else{
  1251. tags[n].innerHTML=nonote;
  1252. }
  1253. }
  1254. }
  1255.  
  1256. function moveimg(){
  1257. if(localStorage.getItem("animationoff")){return;}
  1258. thisfap=this;
  1259. fapbr=thisfap.getElementsByTagName("img")[0].src.split("/")[4].split("?")[0];
  1260. cimg.addEventListener("load",regetimg);
  1261. cimg.src = "https://jpeg.live.mmcdn.com/minifwap/"+fapbr+"?f="+ new Date().getTime();
  1262. }
  1263.  
  1264. function moveimgstop(){
  1265. cimg.removeEventListener("load",regetimg);
  1266. }
  1267.  
  1268. function regetimg(){
  1269. thisfap.getElementsByTagName("img")[0].src=cimg.src;
  1270. setTimeout(function(){ cimg.src = "https://jpeg.live.mmcdn.com/minifwap/"+fapbr+"?f="+ new Date().getTime();}, 50);
  1271. }
  1272.  
  1273. function refresher(){
  1274. document.addEventListener("visibilitychange", function(){
  1275. if (document.hidden){return;}
  1276. if (roomname=="followed-cams"){
  1277. if (!localStorage.getItem("refreshoff")){
  1278. location.reload();
  1279. }
  1280. }
  1281. setsw();
  1282. });
  1283. }
  1284.  
  1285. function noadd(){
  1286. if (document.getElementsByClassName('ad').length>0){
  1287. document.getElementsByClassName('ad')[0].innerHTML="";
  1288.  
  1289. var newelem=document.createElement('div');
  1290. newelem.className="adinfo";
  1291.  
  1292. var newdiv=document.createElement('div');
  1293. newdiv.id="scriptinfo";
  1294. newdiv.className="adscriptinfo";
  1295. newdiv.style.backgroundColor="darkred";
  1296. newelem.appendChild(newdiv);
  1297.  
  1298. newdiv=document.createElement('div');
  1299. newdiv.style.width="4px";
  1300. newdiv.style.backgroundColor="white";
  1301. newelem.appendChild(newdiv);
  1302.  
  1303. newdiv=document.createElement('div');
  1304. newdiv.id="userinfo";
  1305. newdiv.className="adscriptinfo";
  1306. newdiv.style.backgroundColor="darkblue";
  1307. newelem.appendChild(newdiv);
  1308. document.getElementsByClassName('ad')[0].appendChild(newelem);
  1309. var info=scriptname+" version "+version+" is active.";
  1310. newdiv=document.createElement('div');
  1311. newdiv.style.margin="5px";
  1312. if (!readCookie("goodboy")){
  1313. if (!login){
  1314. info=info+"<br>Support this script, <a href='"+tour+"'>create a new account.</a>";
  1315. if(document.querySelector('[data-testid="sign-up-tab"]')){
  1316. document.querySelector('[data-testid="sign-up-tab"]').href=tour;
  1317. }
  1318. }else{
  1319. info=info+"<br>Support this script, log out and create a new account.";
  1320. }
  1321. newdiv.innerHTML=info;
  1322. }else{
  1323. newdiv.innerHTML=info+"<br>Thank you for your support.";
  1324. }
  1325. document.getElementById("scriptinfo").appendChild(newdiv);
  1326.  
  1327. newdiv=document.createElement('div');
  1328. newdiv.style.margin="5px";
  1329. if (!localStorage.getItem("topinfo")){
  1330. newdiv.innerHTML="Info not yet available.";
  1331. }else{
  1332. var topinfo=localStorage.getItem("topinfo").split("{")[1].split("}")[0];
  1333. topinfo=topinfo.replace(/\[/g,"<");
  1334. topinfo=topinfo.replace(/\]/g,">");
  1335. newdiv.innerHTML=topinfo;
  1336. }
  1337. document.getElementById("userinfo").appendChild(newdiv);
  1338. }
  1339. }
  1340.  
  1341. function getmessage(){
  1342. if (!localStorage.getItem("topinfo")){
  1343. getmessage2();
  1344. return;
  1345. }
  1346. var exp=parseInt(localStorage.getItem("topinfo").split("{")[0].split("expires:")[1]);
  1347. if (exp<new Date().getTime()){
  1348. getmessage2();
  1349. }
  1350. }
  1351.  
  1352. function getmessage2(){
  1353. var url=domain+"api/chatvideocontext/"+stor+"/";
  1354. var topinfo="";
  1355. fetch(url,{ credentials: "omit"}).then(
  1356. function(response) {
  1357. if (response.status !== 200){
  1358. topinfo = "{An error occured retrieving the info}";
  1359. var exp=new Date().getTime()+3600000;
  1360. localStorage.setItem("topinfo","expires:"+exp+topinfo);
  1361. return;
  1362. }
  1363. response.json().then(function(roomdata) {
  1364. topinfo="{No info available}";
  1365. if (roomdata.chat_rules!=""){
  1366. topinfo=roomdata.chat_rules;
  1367. }
  1368. var exp=new Date().getTime()+14400000;
  1369. localStorage.setItem("topinfo","expires:"+exp+topinfo);
  1370. });
  1371. });
  1372. }
  1373.  
  1374. function aff(){
  1375. if (currpage==domain+"accounts/welcome/"){createCookie("goodboy","1",14);return;}
  1376. if (currpage.split("?").length>1){
  1377. if (currpage.split("?")[1].indexOf("campaign=hgg5k")!=-1){
  1378. createCookie("agreeterms","1",30);
  1379. if (!login){
  1380. document.location.href=domain+"accounts/register/?src=header&auipsrc=navbar";
  1381. }
  1382. return;
  1383. }
  1384. if (currpage.split("?")[1].indexOf("campaign=")!=-1){
  1385. if(!login){
  1386. untrace();
  1387. document.location.href=tour;
  1388. }
  1389. return;
  1390. }
  1391. }
  1392. if (currpage.split("?")[0]==domain+"auth/login/"){
  1393. localStorage.clear();
  1394. sessionStorage.clear();
  1395. }
  1396. if (currpage.split("?")[0]==domain+"accounts/register/"){
  1397. localStorage.clear();
  1398. sessionStorage.clear();
  1399. }
  1400. }
  1401. function untrace(){
  1402. var cookies = document.cookie.split("; ");
  1403. for (var c = 0; c < cookies.length; c++) {
  1404. var d = window.location.hostname.split(".");
  1405. while (d.length > 0) {
  1406. var cookieBase = encodeURIComponent(cookies[c].split(";")[0].split("=")[0]) + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain=' + d.join('.') + ' ;path=';
  1407. var p = location.pathname.split('/');
  1408. document.cookie = cookieBase + '/';
  1409. while (p.length > 0) {
  1410. document.cookie = cookieBase + p.join('/');
  1411. p.pop();
  1412. }
  1413. d.shift();
  1414. }
  1415. }
  1416. localStorage.clear();
  1417. sessionStorage.clear();
  1418. }
  1419.  
  1420. function subsel(){
  1421. if (discoverpage){return;}
  1422. if (document.getElementById("subselection")){document.getElementById("subselection").remove();}
  1423. if((document.location.href.indexOf("spy-on-cams")==-1)&&(document.location.href.indexOf("followed-cams")==-1)&&(document.location.href.indexOf("/current_app_use/")==-1)){
  1424. var newelem=document.createElement('li');
  1425. newelem.id="subselection";
  1426. var data='<form><select id="subsel" style="margin: 0px 0px 0px 0px; border-radius: 4px 4px 0px 0px;padding: 5px 1px 4px 12px; font-weight: 400; font-size: 13px; font-family: \'UbuntuMedium\',Arial,Helvetica,sans-serif;" >'+
  1427. '<option value="/XX-cams">ALL CAMS IN CATEGORY</option>'+
  1428. '<option value="/exhibitionist-cams/XX">EXHIBITIONIST CAMS</option>'+
  1429. '<option value="/gaming-cams/XX">GAMING CAMS</option>'+
  1430. '<option value="/new-cams/XX">NEW CAMS</option>'+
  1431. '<option value="/teen-cams/XX">TEEN CAMS (18+)</option>'+
  1432. '<option value="/18to21-cams/XX">18 TO 21 CAMS</option>'+
  1433. '<option value="/21to35-cams/XX">21 TO 35 CAMS</option>'+
  1434. '<option value="/30to50-cams/XX">30 TO 50 CAMS</option>'+
  1435. '<option value="/mature-cams/XX">MATURE CAMS (50+)</option>'+
  1436. '<option value="/north-american-cams/XX">NORTH AMERICAN CAMS</option>'+
  1437. '<option value="/euro-russian-cams/XX">EURO RUSSIAN CAMS</option>'+
  1438. '<option value="/south-american-cams/XX">SOUTH AMERICAN CAMS</option>'+
  1439. '<option value="/asian-cams/XX">ASIAN CAMS</option>'+
  1440. '<option value="/other-region-cams/XX">OTHER REGION CAMS</option>'+
  1441. '<option value="/6-tokens-per-minute-private-cams/XX">6 TOKENS PER MINUTE</option>'+
  1442. '<option value="/12-18-tokens-per-minute-private-cams/XX">12 - 18 TOKENS PER MINUTE</option>'+
  1443. '<option value="/30-42-tokens-per-minute-private-cams/XX">30 - 42 TOKENS PER MINUTE</option>'+
  1444. '<option value="/60-72-tokens-per-minute-private-cams/XX">60 - 72 TOKENS PER MINUTE</option>'+
  1445. '<option value="/90-tokens-per-minute-private-cams/XX">90+ TOKENS PER MINUTE</option>'+
  1446. '</select></form>';
  1447. var uloc=document.location.href+"//";
  1448. var loc=uloc.split("/");
  1449. var check=loc[3]+loc[4];
  1450. var gen="";
  1451. if(check.indexOf("male") != -1){gen="male";}
  1452. if(check.indexOf("female") != -1){gen="female";}
  1453. if(check.indexOf("couple") != -1){gen="couple";}
  1454. if(check.indexOf("trans") != -1){gen="trans";}
  1455. data=data.replace(/XX/gi,gen);
  1456. if (gen === ""){data=data.replace("-cams","");}
  1457. data=data.replace('<option value="/'+loc[3],'<option selected value="/'+loc[3]);
  1458. newelem.innerHTML=data;
  1459. document.getElementsByClassName('sub-nav')[0].appendChild(newelem);
  1460. document.getElementById("subsel").addEventListener('change',subselected);
  1461. }
  1462. }
  1463.  
  1464. function subselected(){
  1465. document.location.href=document.getElementById("subsel").options[document.getElementById("subsel").selectedIndex].value;
  1466. }
  1467.  
  1468. function tabpm(){
  1469. if (document.visibilityState=="visible"){return;}
  1470. if (tabblink==true){return;}
  1471. tabblink=true;
  1472. tabblinker();
  1473. }
  1474.  
  1475. function tabblinker(){
  1476. if (document.title == "PM !! PM"){
  1477. document.title = "!! PM !!";
  1478. }else{
  1479. document.title = "PM !! PM";
  1480. }
  1481. if (document.visibilityState!="visible"){
  1482. setTimeout(tabblinker,500);
  1483. }else{
  1484. document.title=ctitle;
  1485. tabblink=false;
  1486. }
  1487. }
  1488.  
  1489. function makevidcontrol(){
  1490. var butstyle="margin-right: 5px;color: rgb(255, 255, 255); background-color:#F47321; font-family: UbuntuMedium, Helvetica, Arial, sans-serif; font-size: 12px; padding: 4px 10px 3px; position: relative;right: 1px;top:-4px; float: right; border-radius: 4px; cursor: pointer; display: inline;";
  1491. var slistyle="text-align: left; width: 310px;margin-right: 4px;color: rgb(255, 255, 255); background: rgba(0, 0, 0, 0) linear-gradient(rgb(255, 151, 53) 0%, rgb(255, 158, 54) 50%, rgb(255, 112, 2) 60%) repeat scroll 0% 0%; font-family: UbuntuMedium, Helvetica, Arial, sans-serif; font-size: 12px; text-shadow: rgb(241, 129, 18) 1px 1px 0px; padding: 4px 10px 3px; position: relative; top: 0px; right: 1px; float: right; border-radius: 4px; display: inline;";
  1492. var cbutstyle="margin-right: 5px;color: rgb(255, 255, 255); background: rgba(0, 0, 0, 0) linear-gradient(rgb(255, 151, 53) 0%, rgb(255, 158, 54) 50%, rgb(255, 112, 2) 60%) repeat scroll 0% 0%; font-family: UbuntuMedium, Helvetica, Arial, sans-serif; font-size: 12px; text-shadow: rgb(241, 129, 18) 1px 1px 0px; padding: 4px 10px 3px; position: relative;right: 1px; float: right; border-radius: 4px; cursor: pointer; display: inline;";
  1493. var place2=document.querySelector('[data-paction="BroadcasterFeedback"]');
  1494. if(ppage){
  1495. place2=document.getElementsByClassName("tabBar")[0];
  1496. }
  1497. if (noaccess){
  1498. place2=document.getElementsByClassName("top-section")[0];
  1499. }
  1500. var newelem="";
  1501. if(ppage){
  1502. newelem=document.createElement('span');
  1503. newelem.setAttribute("style", butstyle);
  1504. newelem.innerHTML="FOLLOW";
  1505. newelem.setAttribute("title", "Follow the bitch.");
  1506. newelem.addEventListener("click", followbut);
  1507. newelem.id="followbut";
  1508. newelem.style.display="none";
  1509. place2.appendChild(newelem);
  1510.  
  1511. newelem=document.createElement('span');
  1512. newelem.setAttribute("style", butstyle);
  1513. newelem.innerHTML="UNFOLLOW";
  1514. newelem.setAttribute("title", "Dump her.");
  1515. newelem.addEventListener("click", unfollowbut);
  1516. newelem.style.backgroundColor="#8b8b8b";
  1517. newelem.id="unfollowbut";
  1518. newelem.style.display="none";
  1519. place2.appendChild(newelem);
  1520.  
  1521. newelem=document.createElement('span');
  1522. newelem.setAttribute("style", butstyle);
  1523. newelem.innerHTML="JOIN FAN CLUB";
  1524. newelem.addEventListener("click", function(){
  1525. var fcwindow= window.open(domain+"fanclub/join/"+roomname+"/?source=SupporterSourceJoinFanClubButton","");
  1526. fcwindow.onload = function(){
  1527. fcwindow.addEventListener('unload', function(){setTimeout(function(){
  1528. document.getElementById("fanclubbut").style.display="none";
  1529. document.getElementById("fanclubmembut").style.display="none";
  1530. newinfo();},1000);});
  1531. };
  1532. });
  1533. newelem.style.backgroundColor="#009900";
  1534. newelem.id="fanclubbut";
  1535. newelem.style.display="none";
  1536. place2.appendChild(newelem);
  1537.  
  1538. newelem=document.createElement('span');
  1539. newelem.setAttribute("style", butstyle);
  1540. newelem.innerHTML="MEMBER";
  1541. newelem.addEventListener("click", function(){window.open(domain+"fanclub/join/"+roomname+"/?source=SupporterSourceJoinFanClubButton","");});
  1542. newelem.style.backgroundColor="#009900";
  1543. newelem.id="fanclubmembut";
  1544. newelem.style.display="none";
  1545. place2.appendChild(newelem);
  1546. }
  1547. newelem=document.createElement('span');
  1548. newelem.setAttribute("style", butstyle);
  1549. newelem.innerHTML="VIDEO CONTROLS ON/OFF";
  1550. newelem.addEventListener("click", vcontrol);
  1551. newelem.style.zIndex="90";
  1552. newelem.id="vcontr";
  1553. place2.appendChild(newelem);
  1554.  
  1555. newelem=document.createElement('span');
  1556. newelem.setAttribute("style", butstyle);
  1557. newelem.style.display="none";
  1558. newelem.innerHTML="CHAT CONTROLS ON/OFF";
  1559. newelem.addEventListener("click", ccontrol);
  1560. newelem.id="ccontr";
  1561. place2.appendChild(newelem);
  1562.  
  1563. newelem=document.createElement('span');
  1564. newelem.setAttribute("style", butstyle);
  1565. newelem.innerHTML="CLEAN PROFILE = ON";
  1566. newelem.style.width="125px";
  1567. newelem.style.display="none";
  1568. newelem.id="clean";
  1569. newelem.addEventListener("click", cleancookie);
  1570. place2.appendChild(newelem);
  1571.  
  1572. newelem=document.createElement('span');
  1573. newelem.setAttribute("style", butstyle);
  1574. newelem.innerHTML="RELOAD INFO";
  1575. newelem.addEventListener("click", newinfo);
  1576. if (noaccess){
  1577. newelem.style.display="none";
  1578. }
  1579. newelem.id="infore";
  1580. place2.appendChild(newelem);
  1581.  
  1582. newelem=document.createElement('div');
  1583. newelem.id="controls";
  1584. newelem.style.display="none";
  1585. newelem.style.position="absolute";
  1586. newelem.style.border="2px solid rgb(244, 115, 33)";
  1587. newelem.style.borderRadius="6px";
  1588. newelem.style.width="340px";
  1589. newelem.style.padding="12px";
  1590. newelem.style.marginTop="600px";
  1591. newelem.style.right="320px";
  1592. if ((ppage)||(noaccess)){
  1593. newelem.style.marginTop="140px";
  1594. newelem.style.right="880px";
  1595. }
  1596. newelem.style.zIndex="999";
  1597. newelem.setAttribute("class","popclass");
  1598. document.getElementById("user_information").appendChild(newelem);
  1599.  
  1600. newelem=document.createElement('span');
  1601. newelem.setAttribute("style", cbutstyle);
  1602. newelem.innerHTML="MIRROR VIDEO";
  1603. newelem.addEventListener("click",mirror);
  1604. document.getElementById("controls").appendChild(newelem);
  1605.  
  1606. newelem=document.createElement('span');
  1607. newelem.setAttribute("style", cbutstyle);
  1608. newelem.innerHTML="INVERT VIDEO";
  1609. newelem.addEventListener("click",invert);
  1610. document.getElementById("controls").appendChild(newelem);
  1611.  
  1612. newelem=document.createElement('span');
  1613. newelem.setAttribute("style", cbutstyle);
  1614. newelem.innerHTML="DRAG";
  1615. newelem.style.cursor="move";
  1616. newelem.addEventListener("mousedown",dragMouseDown);
  1617. document.getElementById("controls").appendChild(newelem);
  1618.  
  1619. newelem=document.createElement('br');
  1620. document.getElementById("controls").appendChild(newelem);
  1621. newelem=document.createElement('br');
  1622. document.getElementById("controls").appendChild(newelem);
  1623.  
  1624. newelem=document.createElement('span');
  1625. newelem.setAttribute("style", slistyle);
  1626. newelem.innerHTML="BRIGHTNESS : <input type='range' id='myRange' min=50 max=250 value=100 style='width: 200px;height:11px;cursor: pointer;float: right;'>";
  1627. document.getElementById("controls").appendChild(newelem);
  1628. document.getElementById("myRange").addEventListener("input",badjust);
  1629.  
  1630. newelem=document.createElement('br');
  1631. document.getElementById("controls").appendChild(newelem);
  1632. newelem=document.createElement('br');
  1633. document.getElementById("controls").appendChild(newelem);
  1634.  
  1635. newelem=document.createElement('span');
  1636. newelem.setAttribute("style", slistyle);
  1637. newelem.innerHTML="CONTRAST : <input type='range' id='myRange1' min=25 max=225 value=100 style='width: 200px;height:11px;cursor: pointer;float: right;'>";
  1638. document.getElementById("controls").appendChild(newelem);
  1639. document.getElementById("myRange1").addEventListener("input",cadjust);
  1640.  
  1641. newelem=document.createElement('br');
  1642. document.getElementById("controls").appendChild(newelem);
  1643. newelem=document.createElement('br');
  1644. document.getElementById("controls").appendChild(newelem);
  1645.  
  1646. newelem=document.createElement('span');
  1647. newelem.setAttribute("style", slistyle);
  1648. newelem.innerHTML="SATURATION : <input type='range' id='myRange2' min=0 max=200 value=100 style='width: 200px;height:11px;cursor: pointer;float: right;'>";
  1649. document.getElementById("controls").appendChild(newelem);
  1650. document.getElementById("myRange2").addEventListener("input",sadjust);
  1651.  
  1652. newelem=document.createElement('br');
  1653. document.getElementById("controls").appendChild(newelem);
  1654. newelem=document.createElement('br');
  1655. document.getElementById("controls").appendChild(newelem);
  1656.  
  1657. newelem=document.createElement('span');
  1658. newelem.setAttribute("style", slistyle);
  1659. newelem.innerHTML="HUE : <input type='range' id='myRange3' min=180 max=540 value=360 style='width: 200px;height:11px;cursor: pointer;float: right;'>";
  1660. document.getElementById("controls").appendChild(newelem);
  1661. document.getElementById("myRange3").addEventListener("input",hadjust);
  1662.  
  1663. newelem=document.createElement('br');
  1664. document.getElementById("controls").appendChild(newelem);
  1665. newelem=document.createElement('br');
  1666. document.getElementById("controls").appendChild(newelem);
  1667.  
  1668. newelem=document.createElement('span');
  1669. newelem.setAttribute("style", cbutstyle);
  1670. newelem.innerHTML="STOP RECORDING";
  1671. newelem.id="stopbut";
  1672. newelem.addEventListener("click",recstop);
  1673. document.getElementById("controls").appendChild(newelem);
  1674.  
  1675. newelem=document.createElement('span');
  1676. newelem.setAttribute("style", cbutstyle);
  1677. newelem.innerHTML="RECORD/PAUSE";
  1678. newelem.id="recbut";
  1679. newelem.addEventListener("click",recstart);
  1680. document.getElementById("controls").appendChild(newelem);
  1681.  
  1682. newelem=document.createElement('span');
  1683. newelem.setAttribute("style", cbutstyle);
  1684. newelem.innerHTML="RESET ALL";
  1685. newelem.addEventListener("click",vreset);
  1686. document.getElementById("controls").appendChild(newelem);
  1687.  
  1688. newelem=document.createElement('br');
  1689. document.getElementById("controls").appendChild(newelem);
  1690. newelem=document.createElement('br');
  1691. document.getElementById("controls").appendChild(newelem);
  1692.  
  1693. newelem=document.createElement('span');
  1694. newelem.setAttribute("style", cbutstyle);
  1695. newelem.innerHTML="HIDE CONTROL PANEL";
  1696. newelem.id="vcontr2";
  1697. newelem.addEventListener("click",vcontrol);
  1698. document.getElementById("controls").appendChild(newelem);
  1699.  
  1700. if ((noaccess)||(ppage)){return;}
  1701.  
  1702. newelem=document.createElement('div');
  1703. newelem.id="chatcontrols";
  1704. newelem.style.display="none";
  1705. newelem.style.position="absolute";
  1706. newelem.style.border="2px solid rgb(244, 115, 33)";
  1707. newelem.style.borderRadius="6px";
  1708. newelem.style.width="340px";
  1709. newelem.style.padding="12px";
  1710. newelem.style.top="40px";
  1711. newelem.style.right="10px";
  1712. newelem.style.zIndex="99";
  1713. newelem.setAttribute("class","popclass");
  1714. document.querySelector('[data-testid="room-tab-bar"]').appendChild(newelem);
  1715.  
  1716. newelem=document.createElement('span');
  1717. newelem.setAttribute("style", slistyle);
  1718. newelem.style.margin="2px";
  1719. newelem.innerHTML="Small emoticons : <input type='range' id='c1' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1720. document.getElementById("chatcontrols").appendChild(newelem);
  1721.  
  1722. newelem=document.createElement('span');
  1723. newelem.setAttribute("style", slistyle);
  1724. newelem.style.margin="2px";
  1725. newelem.innerHTML="Notice : <input type='range' id='c2' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1726. document.getElementById("chatcontrols").appendChild(newelem);
  1727.  
  1728. newelem=document.createElement('span');
  1729. newelem.setAttribute("style", slistyle);
  1730. newelem.style.margin="2px";
  1731. newelem.innerHTML="Subject change : <input type='range' id='c3' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1732. document.getElementById("chatcontrols").appendChild(newelem);
  1733.  
  1734. newelem=document.createElement('span');
  1735. newelem.setAttribute("style", slistyle);
  1736. newelem.style.margin="2px";
  1737. newelem.innerHTML="Mod/fan enter-leave : <input type='range' id='c4' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1738. if (document.location.href.split(".").length>2){newelem.style.display="none";}
  1739. document.getElementById("chatcontrols").appendChild(newelem);
  1740.  
  1741. newelem=document.createElement('span');
  1742. newelem.setAttribute("style", slistyle);
  1743. newelem.style.margin="2px";
  1744. newelem.innerHTML="Grey user chat : <input type='range' id='c5' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1745. document.getElementById("chatcontrols").appendChild(newelem);
  1746.  
  1747. newelem=document.createElement('span');
  1748. newelem.setAttribute("style", slistyle);
  1749. newelem.style.margin="2px";
  1750. newelem.innerHTML="Moderator chat : <input type='range' id='c6' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1751. document.getElementById("chatcontrols").appendChild(newelem);
  1752.  
  1753. newelem=document.createElement('span');
  1754. newelem.setAttribute("style", slistyle);
  1755. newelem.style.margin="2px";
  1756. newelem.innerHTML="Lovense messages : <input type='range' id='c8' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1757. document.getElementById("chatcontrols").appendChild(newelem);
  1758.  
  1759. newelem=document.createElement('span');
  1760. newelem.setAttribute("style", slistyle);
  1761. newelem.style.margin="2px";
  1762. newelem.innerHTML="Tips smaller than : <input class='tinput' type='number' id='c7a' min='2' max='1000' value='100' style='width: 4em;height:11px;cursor: pointer; '> tokens.<input type='range' id='c7' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1763. document.getElementById("chatcontrols").appendChild(newelem);
  1764.  
  1765. newelem=document.createElement('span');
  1766. newelem.setAttribute("style", slistyle);
  1767. newelem.style.margin="2px";
  1768. newelem.innerHTML="Translate chat to: <select id='language'></select><input type='range' id='c10' min=0 max=1 value=0 style='width: 40px;height:11px;cursor: pointer;float: right;'>";
  1769. document.getElementById("chatcontrols").appendChild(newelem);
  1770.  
  1771. newelem=document.createElement('span');
  1772. newelem.setAttribute("style", slistyle);
  1773. newelem.style.margin="2px";
  1774. newelem.innerHTML="Tokens recived : <span id='tclear' style='cursor:pointer'> (Clear)</span><span id='c9' style='width: 40px;height:11px;float: right; color:black'>0</span>";
  1775. document.getElementById("chatcontrols").appendChild(newelem);
  1776. tr2=tr2.replace("www.chaturbate","translate.googleapis")+"single?client=gtx&sl=auto&tl=";
  1777. var languages=["Afrikaans","Albanian","Arabic","Armenian","Azerbaijani","Balinese","Basque","Belarusian","Bengali","Bosnian","Bulgarian","Cantonese","Catalan","Chinese","Corsican","Croatian","Czech","Danish","Dutch","English","Estonian","Filipino","Finnish","French","Georgian","German","Greek","Hebrew","Hindi","Hungarian","Icelandic","Indonesian","Irish","Italian","Japanese","Javanese","Kazakh","Korean","Latvian","Limburgan","Lithuanian","Luxembourgish","Macedonian","Maltese","Mongolian","Myanmar","Norwegian","Papiamento","Persian","Polish","Portuguese","Punjabi","Romanian","Russian","Sanskrit","Serbian","Sicilian","Slovak","Slovenian","Somali","Spanish","Sundanese","Swahili","Swedish","Tamil","Thai","Turkish","Ukrainian","Urdu","Uzbek","Vietnamese","Yiddish"];
  1778. var langcode=["af","sq","ar","hy","az","ban","eu","be","bn","bs","bg","yue","ca","zh","co","hr","cs","da","nl","en","et","fil","fi","fr","ka","de","el","he","hi","hu","is","id","ga","it","ja","jv","kk","ko","lv","li","lt","lb","mk","mt","mn","my","no","pap","fa","pl","pt","pa","ro","ru","sa","sr","scn","sk","sl","so","es","su","sw","sv","ta","th","tr","uk","ur","uz","vi","yi"];
  1779. for(i=0;i < languages.length;i++) {
  1780. var option=document.createElement('option');
  1781. option.textContent=languages[i];
  1782. option.value=langcode[i];
  1783. document.getElementById("language").appendChild(option);
  1784. }
  1785. }
  1786.  
  1787. function followbut(){
  1788. var url=domain+"follow/follow/"+roomname+"/";
  1789. var csrftoken= readCookie("csrftoken");
  1790. var data = new FormData();
  1791. data.append( "location", "FollowButton" );
  1792. data.append( "csrfmiddlewaretoken", csrftoken );
  1793. fetch(url,
  1794. {
  1795. method: "POST",
  1796. headers: {
  1797. 'x-requested-with': 'XMLHttpRequest'
  1798. },
  1799. referrer: domain+roomname+"/",
  1800. body: data
  1801. }).then(function(){
  1802. document.getElementById("followbut").style.display="none";
  1803. document.getElementById("unfollowbut").style.display="block";
  1804. });
  1805. }
  1806.  
  1807. function unfollowbut(){
  1808. var url=domain+"follow/unfollow/"+roomname+"/";
  1809. var csrftoken= readCookie("csrftoken");
  1810. var data = new FormData();
  1811. data.append( "location", "FollowButton" );
  1812. data.append( "csrfmiddlewaretoken", csrftoken );
  1813. fetch(url,
  1814. {
  1815. method: "POST",
  1816. headers: {
  1817. 'x-requested-with': 'XMLHttpRequest'
  1818. },
  1819. referrer: domain+roomname+"/",
  1820. body: data
  1821. }).then(function(){
  1822. document.getElementById("unfollowbut").style.display="none";
  1823. document.getElementById("followbut").style.display="block";
  1824. });
  1825. }
  1826.  
  1827. function getvid(){
  1828. vareaid=document.getElementsByTagName("video")[0].id;
  1829. observer3.observe(document.getElementsByTagName("video")[0].parentNode, observerConfig3);
  1830. }
  1831.  
  1832. function varea(){
  1833. if((ppage)||(noaccess)){
  1834. var video=document.getElementsByTagName("video")[0];
  1835. video.style.filter=vfilter;
  1836. video.style.transform=vmirror;
  1837. return video;
  1838. }
  1839. var vnode=document.getElementById(vareaid);
  1840. if(!vnode){
  1841. vnode=document.getElementById("chat-player");
  1842. if(!vnode){
  1843. return;
  1844. }
  1845. }
  1846. vnode.style.filter=vfilter;
  1847. vnode.style.transform=vmirror;
  1848. if (document.querySelector('[data-testid="video-container"]')&&vnode.src){
  1849. document.querySelector('[data-testid="video-container"]').style.background="rgb(51, 51, 51)";
  1850. }
  1851. document.getElementById("vcontr").style.display="block";
  1852. if (!vnode.src){
  1853. recstop();
  1854. document.getElementById("vcontr").style.display="none";
  1855. document.getElementById("controls").style.display="none";
  1856. }
  1857. return vnode;
  1858. }
  1859.  
  1860. function badjust(){
  1861. br=document.getElementById("myRange").value;
  1862. ofils=varea().style.filter.split(" ");
  1863. vfilter="brightness("+br+"%) "+ofils[1]+" "+ofils[2]+" "+ofils[3]+" "+ofils[4];
  1864. varea();
  1865. }
  1866.  
  1867. function cadjust(){
  1868. br=document.getElementById("myRange1").value;
  1869. ofils=varea().style.filter.split(" ");
  1870. vfilter=ofils[0]+" contrast("+br+"%) "+ofils[2]+" "+ofils[3]+" "+ofils[4];
  1871. varea();
  1872. }
  1873.  
  1874. function sadjust(){
  1875. br=document.getElementById("myRange2").value;
  1876. ofils=varea().style.filter.split(" ");
  1877. vfilter=ofils[0]+" "+ofils[1]+" "+ofils[2]+" saturate("+br+"%) "+ofils[4];
  1878. varea();
  1879. }
  1880.  
  1881. function hadjust(){
  1882. br=document.getElementById("myRange3").value;
  1883. if (br > 359){br=br-360;}
  1884. ofils=varea().style.filter.split(" ");
  1885. vfilter=ofils[0]+" "+ofils[1]+" "+ofils[2]+" "+ofils[3]+" hue-rotate("+br+"deg)";
  1886. varea();
  1887. }
  1888.  
  1889. function invert(){
  1890. ofils=varea().style.filter.split(" ");
  1891. br=" invert(100%) ";
  1892. if (ofils[2]=="invert(100%)"){br=" invert(0%) ";}
  1893. vfilter=ofils[0]+" "+ofils[1]+br+ofils[3]+" "+ofils[4];
  1894. varea();
  1895. }
  1896.  
  1897. function mirror(){
  1898. if (varea().style.transform=="none"){
  1899. vmirror="matrix(-1, 0, 0, 1, 0, 0)";
  1900. varea();
  1901.  
  1902. }else{
  1903. vmirror="none";
  1904. varea();
  1905. }
  1906. }
  1907.  
  1908. function vreset(){
  1909. vfilter="brightness(100%) contrast(100%) invert(0%) saturate(100%) hue-rotate(0deg)";
  1910. vmirror="none";
  1911. varea();
  1912. document.getElementById("myRange").value=100;
  1913. document.getElementById("myRange1").value=100;
  1914. document.getElementById("myRange2").value=100;
  1915. document.getElementById("myRange3").value=360;
  1916. }
  1917.  
  1918. function vcontrol(){
  1919. if (document.getElementById("controls").style.display=="block"){
  1920. if (recording){return;}
  1921. document.getElementById("controls").style.display="none";
  1922. }else{
  1923. document.getElementById("controls").style.display="block";
  1924. }
  1925. }
  1926.  
  1927. function dragMouseDown(e) {
  1928. e = e || window.event;
  1929. e.preventDefault();
  1930. pos3 = e.clientX;
  1931. pos4 = e.clientY;
  1932. document.onmouseup = closeDragElement;
  1933. document.onmousemove = elementDrag;
  1934. }
  1935.  
  1936. function elementDrag(e) {
  1937. e = e || window.event;
  1938. e.preventDefault();
  1939. pos1 = pos3 - e.clientX;
  1940. pos2 = pos4 - e.clientY;
  1941. pos3 = e.clientX;
  1942. pos4 = e.clientY;
  1943. var x =parseInt(document.getElementById("controls").style.right);
  1944. var y =parseInt(document.getElementById("controls").style.marginTop);
  1945. if ((pos3>=110)&&(pos3<=window.innerWidth-324)){
  1946. document.getElementById("controls").style.right = (x + pos1) + "px";
  1947. }
  1948. if ((y-pos2>-50)&&(pos4<=window.innerHeight-20)){
  1949. document.getElementById("controls").style.marginTop = (y - pos2) + "px";
  1950. }
  1951. }
  1952.  
  1953. function closeDragElement() {
  1954. document.onmouseup = null;
  1955. document.onmousemove = null;
  1956. }
  1957.  
  1958. function info(anon){
  1959. fetching++;
  1960. var cred="same-origin";
  1961. if (!anon){cred="omit";}
  1962. var url=domain+"api/chatvideocontext/"+roomname+"/";
  1963. fetch(url,{ credentials: cred}).then(
  1964. function(response) {
  1965. if (response.status !== 200){
  1966. wprof("Error:","<div style='color:red'>You have no access to this room</div>");
  1967. if (anon){
  1968. noaccess=true;
  1969. fetching--;
  1970. info(false);
  1971. }
  1972. fetching--;
  1973. return;
  1974. }
  1975. response.json().then(function(roomdata) {
  1976. data=roomdata;
  1977. fetching--;
  1978. if (biodata==""){
  1979. fanbiodata();
  1980. }else{
  1981. setprofileinfo();
  1982. }
  1983. });
  1984. });
  1985. }
  1986.  
  1987. function fanbiodata(){
  1988. var url=domain+"api/biocontext/"+roomname;
  1989. fetch(url,{ credentials: "omit",referrer: domain+roomname+"/"}).then(
  1990. function(response) {
  1991. if (response.status !== 200){
  1992. setprofileinfo();
  1993. return;
  1994. }
  1995. response.json().then(function(data) {
  1996. biodata=data;
  1997. setprofileinfo();
  1998. });
  1999. });
  2000. }
  2001.  
  2002. function setprofileinfo(){
  2003. room_status=data.room_status;
  2004. username=data.viewer_username;
  2005. if (room_status =="offline"){
  2006. document.getElementById("vcontr").style.display="none";
  2007. }
  2008. if(ppage){
  2009. document.getElementById("vcontr").style.display="none";
  2010. document.getElementsByClassName("voteText")[0].innerHTML="";
  2011. document.getElementsByClassName("voteText")[1].innerHTML="";
  2012. document.getElementsByClassName("highPercent")[0].innerHTML="";
  2013. if (data.satisfaction_score.up_votes){
  2014. document.getElementsByClassName("voteText")[0].innerHTML=data.satisfaction_score.up_votes;
  2015. document.getElementsByClassName("voteText")[1].innerHTML=data.satisfaction_score.down_votes;
  2016. document.getElementsByClassName("highPercent")[0].innerHTML=data.satisfaction_score.percent+"%";
  2017. if (data.satisfaction_score.percent<85){
  2018. document.getElementsByClassName("highPercent")[0].style.color="red";
  2019. }
  2020. }
  2021. }
  2022. wprof("Find:","<a href='https://camgirlfinder.net/models?m="+roomname+"&p=cb&g=a' rel=noreferrer target='_new'>Open in camgirlfinder</a>");
  2023. wprof("Statistics:","<a href='https://statbate.com/search/1/"+roomname+"' rel=noreferrer target='_new'>Open in statbate</a>");
  2024. wprof("Schedule:","<a href='https://www.cbhours.com/user/"+roomname+".html' rel=noreferrer target='_new'>Open in cbhours</a>");
  2025. if (document.getElementById("vcontr").style.display=="none"){
  2026. if (!data.opt_out){
  2027. wprof("Full video (anon):","<a href='https://www.girls4cock.com/fullvideo/?b="+roomname+"' rel=noreferrer target='_new'>Open full video mode as anonymous</a>");
  2028. if (!noaccess){
  2029. wprof("Full video:","<a href='"+domain+"fullvideo/?b="+roomname+"' rel=noreferrer target='_new'>Open full video mode</a>");
  2030. }
  2031. }
  2032. }
  2033. if (data.opt_out){
  2034. wprof("On network sites:","No");
  2035. }
  2036. makerulesarea(data.chat_rules);
  2037. if(data.chat_rules!=""){
  2038. wprof ("Chat rules:","<a href=# id='rulesview'>Yes, click to read</a>");
  2039. document.getElementById("rulesview").addEventListener("click",function(){
  2040. if(document.getElementById("rulespop").style.display=="none"){
  2041. document.getElementById("rulespop").innerHTML=chatrules;
  2042. document.getElementById("rulespop").style.display="block";
  2043. }
  2044. else{
  2045. document.getElementById("rulespop").style.display="none";
  2046. document.getElementById("rulespop").innerHTML="";
  2047. }
  2048. });
  2049. }
  2050. if(ppage){
  2051. if(!noaccess){
  2052. if (data.following){
  2053. document.getElementById("unfollowbut").style.display="block";
  2054. }else{
  2055. document.getElementById("followbut").style.display="block";
  2056. }
  2057. if (data.fan_club_is_member){
  2058. document.getElementById("fanclubmembut").style.display="block";
  2059. }else{
  2060. if (data.performer_has_fanclub){
  2061. document.getElementById("fanclubbut").style.display="block";
  2062. }
  2063. }
  2064. }
  2065. }
  2066. if (room_status =="offline"){
  2067. if (biodata.last_broadcast){
  2068. wprof("Last online:",biodata.last_broadcast.split("T")[0]);
  2069. }
  2070. }
  2071. if (data.num_viewers!=0){
  2072. wprof("Users in room:",data.num_viewers+"<a href=# id='userview'> (Click to view)</a>");
  2073. document.getElementById("userview").addEventListener("click",getuserlist);
  2074. }else{
  2075. wprof("Users in room:","0");
  2076. }
  2077. if (data.low_satisfaction_score){
  2078. wprof("Satisfaction score:","<font color=#CC0000>LOW !!!</font>");
  2079. }
  2080. if (data.is_moderator){
  2081. wprof("Moderator:","Yes");
  2082. }
  2083. if (data.fan_club_is_member){
  2084. wprof("Fanclub member:","Yes");
  2085. }
  2086. if ((room_status=="offline")||(ppage)){
  2087. wprof("Room topic:","<div style='width:450px;height:auto'>"+data.room_title+"</div>");
  2088. }
  2089. if (ppage){
  2090. if (room_status.indexOf("hidden")!=-1){
  2091. wprof("Hidden message:",data.hidden_message);
  2092. }
  2093. }
  2094. if (room_status != "offline"){
  2095. hls_source=data.hls_source;
  2096. cmaf=data.cmaf_edge;
  2097. if (cmaf){
  2098. hls_source=hls_source.replace(".m3u8","_sfm4s.m3u8");
  2099. hls_source=hls_source.replace("live-edge","live-fhls");
  2100. }
  2101. videoSrc=hls_source;
  2102. navigator.clipboard.writeText(hls_source);
  2103. var vidqual=data.quality.quality;
  2104. if (!vidqual){vidqual= "unknown";}
  2105. wprof("Video quality:",vidqual+'<font color=#CC0000 id="vstatus"></font>');
  2106. }
  2107. wprof("Video:",'<div id="rstatus">'+room_status+'</div>');
  2108. if (data.is_age_verified){
  2109. wprof("Alarm:","<div id='alarm'><div>");
  2110. makealarm();
  2111. }
  2112. wprof("Video Url:","<a href=# id='hls'>Click to copy to clipboard/Update status</a>");
  2113. document.getElementById("hls").addEventListener("click",function(){getnewhls(!noaccess,true);});
  2114. if (data.tips_in_past_24_hours !== 0){
  2115. wprof("You tipped:",data.tips_in_past_24_hours+" Tk/24h");
  2116. }
  2117. if (!data.opt_out){
  2118. wprof("Nationality:","<span id='flaginfo'>wait....</span>");
  2119. wprof("Region:","<span id='regioninfo'>wait....</span>");
  2120. getregion(false);
  2121. }
  2122. if (biodata.performer_has_fanclub){
  2123. wprof("Fanclub costs:",biodata.fan_club_cost*3+" Tk / 3 Months");
  2124. }
  2125. if (!data.is_age_verified){
  2126. wprof("Status:","Exhibitionist");
  2127. }else{
  2128. if (data.allow_private_shows){
  2129. wprof("Private recording:",data.allow_show_recordings ? "Yes":"No");
  2130. if (data.spy_private_show_price!=0){
  2131. if (data.premium_private_price!=0){
  2132. wprof("Min. premium private:",data.premium_private_min_minutes+" Minutes");
  2133. wprof("Premium privateshow:",data.premium_private_price+" Tk/min");
  2134. }
  2135. }
  2136. if (data.spy_private_show_price !== 0){
  2137. if ((data.fan_club_spy_private_show_price !==null)&&(data.fan_club_spy_private_show_price!==data.spy_private_show_price)){
  2138. if(data.fan_club_spy_private_show_price==0){
  2139. wprof("Fan Spy on private:","Free");
  2140. }else{
  2141. wprof("Fan Spy on private:",data.fan_club_spy_private_show_price+" Tk/min");
  2142. }
  2143. }
  2144. wprof("Spy on private:",data.spy_private_show_price+" Tk/min");
  2145. }else{
  2146. wprof("Spy on private:","Disabled");
  2147. }
  2148. wprof("Minimum private:",data.private_min_minutes+" Minutes");
  2149. wprof("Privateshow:",data.private_show_price+" Tk/min");
  2150. }else{
  2151. wprof("Privateshow:","Disabled");
  2152. }
  2153. }
  2154. if (login){
  2155. if (!noaccess){
  2156. if (roomname!=yourname){
  2157. wprof ("DM:","<a href='"+domain+"dm/"+roomname+"/' id='dmpop'>Open window</a>");
  2158. document.getElementById("dmpop").addEventListener("click", function(event){opendm(this);event.stopPropagation();event.preventDefault();return false;});
  2159. }
  2160. }
  2161. getnotes();
  2162. createimage();
  2163. }
  2164. if ((room_status!="offline")&&(!ppage)){chatchange();}
  2165. }
  2166.  
  2167. function getuserlist(){
  2168. if(document.getElementById("rulespop").style.display=="block"){
  2169. document.getElementById("rulespop").style.display="none";
  2170. document.getElementById("rulespop").innerHTML="";
  2171. return;
  2172. }else{
  2173. document.getElementById("rulespop").style.display="block";
  2174. }
  2175.  
  2176. var listurl=domain+"api/getchatuserlist/?sort_by=a&roomname="+roomname+"&exclude_staff=false";
  2177. fetch(listurl,{credentials: "omit",referrerPolicy: "no-referrer"}).then(
  2178. function(response) {
  2179. if (response.status !== 200){
  2180. return;
  2181. }
  2182. response.text().then(function(userdata) {
  2183. formatuserlist(userdata);
  2184. });
  2185. });
  2186. }
  2187.  
  2188. function makealarm(){
  2189. var newelem=document.createElement('span');
  2190. newelem.innerHTML="Off <input type='range' id='alrm' min=0 max=1 value=0 style='width: 35px;height:auto;cursor: pointer'> On <span id='aonly'>|| Alarm only <input type='range' id='alrmtype' min=0 max=1 value=0 style='width: 35px;height:auto;cursor: pointer'> Go to page if public</span>";
  2191. document.getElementById("alarm").appendChild(newelem);
  2192. document.getElementById("alrm").addEventListener("change",setalrm);
  2193. if(document.querySelector('[data-testid="offline-content-container"]')){
  2194. if(document.querySelector('[data-testid="offline-content-container"]').style.display=="none"){
  2195. document.getElementById("aonly").style.display="none";
  2196. }
  2197. }
  2198. document.title=ctitle;
  2199. }
  2200.  
  2201. function setalrm(){
  2202. if (document.getElementById("alrm").value==0){document.title=ctitle;return;}
  2203. ctitle=document.title;
  2204. document.title="\u23F0 "+ctitle;
  2205. getnewhls(true,false);
  2206. setTimeout(function(){
  2207. oldroomstatus=roomstatus;
  2208. if(!alarmrun){
  2209. alarmrun=true;
  2210. testalarm();}},1000);
  2211. }
  2212.  
  2213. function testalarm(){
  2214. setTimeout(function(){
  2215. if(document.getElementById("alrm").value==0){alarmrun=false;return;}
  2216. getnewhls(true,false,2);
  2217. }, 60000);
  2218. }
  2219.  
  2220. function testalarm2(){
  2221. if (roomstatus != oldroomstatus){
  2222. if(document.getElementById("alrmtype").value==1){
  2223. if (roomstatus=="public"){
  2224. forceopen(roomname);
  2225. }
  2226. oldroomstatus=roomstatus;
  2227. if (alarmrun){
  2228. testalarm();
  2229. return;
  2230. }
  2231. }
  2232. playalarm();
  2233. alarmtab();
  2234. alarmrun=false;
  2235. }else{
  2236. if (alarmrun){
  2237. testalarm();
  2238. }
  2239. }
  2240. }
  2241.  
  2242. function playalarm(){
  2243. if (document.getElementById("alrm")){
  2244. if (document.getElementById("alrm").value==0){return;}
  2245. }
  2246. alarmaudio.play();
  2247. setTimeout(playalarm,2000);
  2248. }
  2249.  
  2250. function alarmtab(){
  2251. if (document.getElementById("alrm")){
  2252. if (document.getElementById("alrm").value==0){document.title=ctitle;return;}
  2253. }
  2254. if (document.title != "ALARM"){
  2255. document.title = "ALARM";
  2256. }else{
  2257. document.title = "!!!!!!";
  2258. }
  2259. setTimeout(alarmtab,500);
  2260. }
  2261.  
  2262. function formatuserlist(userdata){
  2263. var userarray=userdata.split(",");
  2264. var height=15*userarray.length+120;
  2265. var scroll="";
  2266. if (height<240){height=240;}
  2267. if (height>500){height=500;scroll=";overflow-y:scroll";}
  2268. var userstring="<div style='float:right;color:black'>(Close)</div><div onclick='event.stopPropagation()' style='cursor:default;color:black;width:350px;height:"+height+"px"+scroll+"'>";
  2269. for (i=1; i<userarray.length; i++){
  2270. var user=userarray[i].split("|");
  2271. if (user[1]=="o"){user[1]="#dc5500";}
  2272. if (user[1]=="m"){user[1]="#dc0000";}
  2273. if (user[1]=="f"){user[1]="#090";}
  2274. if (user[1]=="l"){user[1]="#804baa";}
  2275. if (user[1]=="p"){user[1]="#be6aff";}
  2276. if (user[1]=="tr"){user[1]="#1e5cfb";}
  2277. if (user[1]=="t"){user[1]="#69a";}
  2278. if (user[1]=="g"){user[1]="#939393";}
  2279. if (user[2]=="m"){user[2]="https://web.static.mmcdn.com/tsdefaultassets/gendericons/male.svg";}
  2280. if (user[2]=="f"){user[2]="https://web.static.mmcdn.com/tsdefaultassets/gendericons/female.svg";}
  2281. if (user[2]=="c"){user[2]="https://web.static.mmcdn.com/tsdefaultassets/gendericons/couple.svg";}
  2282. if (user[2]=="s"){user[2]="https://web.static.mmcdn.com/tsdefaultassets/gendericons/trans.svg";}
  2283. if (user[3]=="t"){user[3]="(Follower)";}
  2284. if (user[3]=="f"){user[3]="";}
  2285. if ((user[0]==roomname)||(user[0]==yourname)){
  2286. userstring=userstring+"<img style='height:16px' src='"+user[2]+"'><a style='font-weight: bold;color:"+user[1]+"'>"+user[0]+"</a> "+user[3]+"<br>";
  2287. }else{
  2288. if (loggedin){
  2289. userstring=userstring+"<img style='height:16px' src='"+user[2]+"'><a target=_blank style='font-weight: bold;color:"+user[1]+"' href='"+domain+"p/"+yourname+"?tab=bio&model="+user[0]+"'>"+user[0]+"</a> "+user[3]+"<br>";
  2290. }else{
  2291. userstring=userstring+"<img style='height:16px' src='"+user[2]+"'><a target=_blank style='font-weight: bold;color:"+user[1]+"' href='"+domain+user[0]+"'>"+user[0]+"</a> "+user[3]+"<br>";
  2292. }
  2293. }
  2294. }
  2295. userstring=userstring+"+"+userarray[0].split("|")[0]+" Anonymous users.</div>";
  2296. document.getElementById("rulespop").innerHTML=userstring;
  2297. }
  2298.  
  2299. function chatchange(){
  2300. document.getElementById("ccontr").style.display="block";
  2301. document.getElementById("c1").addEventListener("change",chatsetchange);
  2302. document.getElementById("c2").addEventListener("change",chatsetchange);
  2303. document.getElementById("c3").addEventListener("change",chatsetchange);
  2304. document.getElementById("c4").addEventListener("change",chatsetchange);
  2305. document.getElementById("c5").addEventListener("change",chatsetchange);
  2306. document.getElementById("c6").addEventListener("change",chatsetchange);
  2307. document.getElementById("c7").addEventListener("change",chatsetchange);
  2308. document.getElementById("c7a").addEventListener("change",chatsetchange);
  2309. document.getElementById("c8").addEventListener("change",chatsetchange);
  2310. document.getElementById("c10").addEventListener("change",chatsetchange);
  2311. var chatobserver = new MutationObserver(chatadjust);
  2312. var pmchatobserver = new MutationObserver(pmchatadjust);
  2313. var chatobserverConfig = {childList: true};
  2314. var observenode=document.getElementsByClassName("message-list")[0];
  2315. var pmobservenode=document.getElementsByClassName("message-list")[1];
  2316. if (localStorage.getItem(roomname+"Tokens")){
  2317. document.getElementById("c9").innerHTML=localStorage.getItem(roomname+"Tokens");
  2318. firstentry=false;
  2319. }
  2320. document.getElementById("tclear").addEventListener("click",cleartokens);
  2321. chatobserver.observe(observenode,chatobserverConfig);
  2322. pmchatobserver.observe(pmobservenode,chatobserverConfig);
  2323. }
  2324. function pmchatadjust(){
  2325. tabpm();
  2326. chatadjust();
  2327. }
  2328. function cleartokens(){
  2329. document.getElementById("c9").innerHTML=0;
  2330. localStorage.removeItem(roomname+"Tokens");
  2331. }
  2332.  
  2333. function chatsetchange(){
  2334. c1=document.getElementById("c1").value;
  2335. c2=document.getElementById("c2").value;
  2336. c3=document.getElementById("c3").value;
  2337. c4=document.getElementById("c4").value;
  2338. c5=document.getElementById("c5").value;
  2339. c6=document.getElementById("c6").value;
  2340. c7=document.getElementById("c7").value;
  2341. c7a=document.getElementById("c7a").value;
  2342. if (c7a<2){c7a=2;document.getElementById("c7a").value=2;}
  2343. if (c7a>1000){c7a=1000;document.getElementById("c7a").value=1000;}
  2344. c8=document.getElementById("c8").value;
  2345. c10=document.getElementById("c10").value;
  2346. smallemoonoff();
  2347. chatadjust();// after change
  2348. }
  2349.  
  2350. function chatadjust(){
  2351. if (!firstentry){
  2352. twaiting=true;
  2353. setTimeout(function(){twaiting=false;}, 200);
  2354. firstentry=true;
  2355. }
  2356. var tags=document.getElementsByClassName('msg-list-fvm');
  2357. for (n=0; n<tags.length; n++){
  2358. chattamper(n);
  2359. }
  2360. }
  2361.  
  2362. function chattamper(tag){
  2363. var messages=document.getElementsByClassName('msg-list-fvm')[tag].querySelectorAll('[data-testid="chat-message"]');
  2364. var chatmessages=messages.length;
  2365. if (chatmessages==0){return;}
  2366. var translated=0;
  2367. for (i = chatmessages-1; i > 0; i--) {
  2368. var noticeelm=messages[i].querySelector('[data-testid="room-notice"]');
  2369. if (noticeelm!=null){
  2370. var noticeclasses=noticeelm.classList;
  2371. var notetext=noticeelm.querySelector('[data-testid="room-notice-viewport"]').textContent;
  2372. if (noticeclasses.length==1){
  2373. if (notetext.indexOf("Notice:")==0){
  2374. if (c2==1){
  2375. messages[i].style.display="none";
  2376. }else{
  2377. messages[i].style.display="block";
  2378. }
  2379. }
  2380. if (notetext.indexOf("Moderator")==0){
  2381. if (c4==1){
  2382. messages[i].style.display="none";
  2383. }else{
  2384. messages[i].style.display="block";
  2385. }
  2386. }
  2387. if (notetext.indexOf("Fan club member")==0){
  2388. if (c4==1){
  2389. messages[i].style.display="none";
  2390. }else{
  2391. messages[i].style.display="block";
  2392. }
  2393. }
  2394. }
  2395. if (noticeclasses.contains("titleChange")){
  2396. if (c3==1){
  2397. messages[i].style.display="none";
  2398. }else{
  2399. messages[i].style.display="block";
  2400. }
  2401. }
  2402. if (noticeclasses.contains("isTip")){
  2403. var tokens=parseInt(notetext.split("tipped ")[1].split(" ")[0]);
  2404. if (tag==0){
  2405. if(messages[i].style.display=="flex"){
  2406. if(!twaiting){
  2407. document.getElementById("c9").innerHTML=parseInt(document.getElementById("c9").innerHTML)+tokens;
  2408. localStorage.setItem(roomname+"Tokens",document.getElementById("c9").innerHTML);
  2409. }
  2410. }
  2411. }
  2412. if ((c7==1)&&(tokens<c7a)){
  2413. messages[i].style.display="none";
  2414. }else{
  2415. messages[i].style.display="block";
  2416. }
  2417. }
  2418. }
  2419. if (messages[i].querySelector('[data-testid="chat-message-text"]')!=null){
  2420. if (messages[i].querySelector('[data-testid="chat-message-username"]').className=="broadcaster"){
  2421. var chattext=messages[i].querySelector('[data-testid="chat-message-text"]').textContent;
  2422. if ((chattext.indexOf("Lovense")!=-1)||(chattext.indexOf("------")!=-1)||(chattext.indexOf("******")!=-1)||(chattext.indexOf("The High Tipper")!=-1)||(chattext.indexOf("The king Tipper")!=-1)||(chattext.indexOf("Special Commands:")!=-1)||(chattext.indexOf("Blitz Mode")!=-1)||(chattext.indexOf("the critical hit rate")!=-1)){
  2423. messages[i].name="notranslate";
  2424. if (c8==1){
  2425. messages[i].style.display="none";
  2426. }else{
  2427. messages[i].style.display="block";
  2428. }
  2429. }
  2430. }
  2431. if (messages[i].querySelector('[data-testid="chat-message-username"]').className=="defaultUser"){
  2432. if (c5==1){
  2433. messages[i].style.display="none";
  2434. }else{
  2435. messages[i].style.display="block";
  2436. }
  2437. }
  2438. if (messages[i].querySelector('[data-testid="chat-message-username"]').className=="mod"){
  2439. if (c6==1){
  2440. messages[i].style.display="none";
  2441. }else{
  2442. messages[i].style.display="block";
  2443. }
  2444. }
  2445. if (c10==1){
  2446. if(!messages[i].name){
  2447. if (messages[i].style.display!="none"){
  2448. var splitmode=true;
  2449. var splitchatblock=false;
  2450. if(document.getElementsByClassName('msg-list-fvm')[tag].classList.contains("message-list")){splitchatblock=true;}
  2451. if(document.getElementById("ChatTabContainer").style.display=="none"){splitmode=false;}
  2452. if ((splitmode&&splitchatblock)||(!splitmode&&!splitchatblock)){
  2453. messages[i].name="translate";
  2454. translated++;
  2455. if (translated<8){
  2456. translate(messages[i]);
  2457. }
  2458. }
  2459. }
  2460. }
  2461. }
  2462. }
  2463. }
  2464. }
  2465.  
  2466. function translate(elm){
  2467. var chattext=elm.querySelector('[data-testid="chat-message-text"]').textContent;
  2468. var result="";
  2469. chattext=chattext.replace(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g,"");
  2470. chattext=chattext.replace(/\./gi,"{.}");
  2471. chattext=chattext.replace(/\?/gi,"{?}");
  2472. chattext=chattext.replace(/\!/gi,"{!}");
  2473. chattext=chattext.replace(/\|/gi,"{|}");
  2474. chattext=chattext.replace(/\&/gi,"{{");
  2475. chattext=chattext.toLowerCase();
  2476. if (chattext.length>2){
  2477. chattext=encodeURI(chattext);
  2478. var lang=document.getElementById("language").options[document.getElementById("language").selectedIndex].value;
  2479. GM_xmlhttpRequest({
  2480. method: "GET",
  2481. timeout: 5000,
  2482. mozAnon: true,
  2483. anonymous: true,
  2484. url: tr2+lang+"&dt=t&q="+chattext,
  2485. onload: function(response) {
  2486. if (response.status !== 200){
  2487. result="Translate error "+response.status;
  2488. }else{
  2489. result=JSON.parse(response.responseText)[0][0][0];
  2490. result=result.replace(/\\u200b/gi,"");
  2491. result=result.replace(/\\u003d/gi,"=");
  2492. result=result.replace(/\\u003c/gi,"<");
  2493. result=result.replace(/\\u003e/gi,">");
  2494. result=result.replace(/\{\{/gi,"&");
  2495. result=result.replace(/\{/gi,"");
  2496. result=result.replace(/\}/gi,"");
  2497. }
  2498. showtranslate(result,elm);
  2499. },
  2500. ontimeout: function(){
  2501. result="Translate error timeout";
  2502. showtranslate(result,elm);
  2503. }
  2504. });
  2505. }
  2506. }
  2507.  
  2508. function showtranslate(result,elm){
  2509. var newelem=document.createElement('span');
  2510. newelem.innerHTML=result;
  2511. newelem.className="translated";
  2512. elm.firstChild.lastElementChild.appendChild(newelem);
  2513. }
  2514.  
  2515. function smallemoonoff(){
  2516. if ((c1==1)&&(document.getElementById("emostyle")==null)){
  2517. var style = document.createElement('style');
  2518. style.setAttribute('type', 'text/css');
  2519. style.id="emostyle";
  2520. style.textContent = "img.emoticonImage {max-height:22px !important;}";
  2521. document.getElementsByTagName('head')[0].appendChild(style);
  2522. }
  2523. if ((c1==0)&&(document.getElementById("emostyle")!=null)){
  2524. document.getElementById("emostyle").remove();
  2525. }
  2526. }
  2527.  
  2528. function ccontrol(){
  2529. if (document.getElementById("chatcontrols").style.display=="block"){
  2530. document.getElementById("chatcontrols").style.display="none";
  2531. }else{
  2532. document.getElementById("chatcontrols").style.display="block";
  2533. }
  2534. }
  2535.  
  2536. function opendm(that){
  2537. var dmwindow= window.open(that.href,'DMpop','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=800');
  2538. dmwindow.onload = function(){
  2539. this.addEventListener('unload', function(){setTimeout(function(){newinfo();},1000);});
  2540. };
  2541. }
  2542.  
  2543. function getnotes(){
  2544. var url=domain+"api/notes/for_user/"+roomname+"/";
  2545. fetch(url,{ credentials: "same-origin"}).then(
  2546. function(response) {
  2547. if (response.status !== 200) {
  2548. wprof("Attention:","This room is banned.");
  2549. return;
  2550. }
  2551. response.json().then(function(data) {
  2552. if (data.text == null){data.text="";}
  2553. opennote=data.text;
  2554. buildprofnote();
  2555. });
  2556. });
  2557. }
  2558.  
  2559. function makerulesarea(rule){
  2560. if (document.getElementById("rulespop")){return;}
  2561. var rulestyle="cursor:pointer;z-index:999;top:10px;left:10px;box-shadow:0px 0px 32px rgba(0, 0, 0, 0.32);border-radius:4px;border:1px solid rgb(221, 221, 221);background-color:rgb(200, 200, 200);position:absolute; display:none; white-space: pre-line; text-align: left; line-height: 1.4; height: auto; width:500px; padding: 10px 10px 10px 10px; box-sizing: border-box; overflow-wrap: break-word; word-break: break-word; padding: 15px;";
  2562. var newelem=document.createElement('span');
  2563. newelem.setAttribute("style", rulestyle);
  2564. newelem.id="rulespop";
  2565. chatrules="<div style='color:black'><b>"+roomname+" chatrules:</b><br><br>"+rule+"<br><br><center>(Click to close)</center></div>";
  2566. newelem.addEventListener("click",function(){this.style.display="none";this.innerHTML="";});
  2567. document.querySelector('[data-testid="room-bio-tab-contents"]').appendChild(newelem);
  2568. }
  2569.  
  2570. function createimage(){
  2571. if (!ppage&&!noaccess){return;}
  2572. hls.detachMedia();
  2573. if (document.getElementById("profimg")){document.getElementById("profimg").remove();}
  2574. if (document.getElementById("profjpgimg")){
  2575. pimg.removeEventListener("load",regetimgprof);
  2576. pimg.removeEventListener("error",errorimgprof);
  2577. document.getElementById("profjpgimg").remove();
  2578. removevidplayer();
  2579. }
  2580. if (document.getElementById("vstatus")){document.getElementById("vstatus").innerHTML="";}
  2581. if (videoSrc!=""){
  2582. if ((room_status=="public")||(room_status.indexOf("watching")!=-1)){
  2583. if (!gojpg){
  2584. if (!document.getElementById("profplayer")){
  2585. makevidplayer();
  2586. }
  2587. startvid();
  2588. }else{
  2589. document.getElementById("vstatus").innerHTML=" !!Video error please wait!!";
  2590. removevidplayer();
  2591. makejpgplayer();
  2592. setTimeout(function(){gojpg=false;getnewhls(true,false,1);}, 10000);
  2593. }
  2594. return;
  2595. }
  2596. }
  2597. removevidplayer();
  2598. if ((videoSrc=="")&&(room_status=="public")){
  2599. makejpgplayer();
  2600. return;
  2601. }
  2602. var url="https://jpeg.live.mmcdn.com/minifwap/"+roomname+".jpg";
  2603. fetch(url,{
  2604. cache: "no-cache",
  2605. credentials: "same-origin",referrer: domain}).then(
  2606. function(response){
  2607. response.blob().then(
  2608. function(rawimg){
  2609. var imgsize=rawimg.size;
  2610. if (((imgsize<9500)||(imgsize>9510))&&((imgsize<4800)||(imgsize>4850))){
  2611. makeimg();
  2612. }else{
  2613. makecrd();
  2614. }
  2615. });
  2616. }
  2617. );
  2618. }
  2619.  
  2620. function removevidplayer(){
  2621. if (document.getElementById("profplayer")){
  2622. document.removeEventListener("visibilitychange",vidpause);
  2623. document.getElementById("profplayer").remove();
  2624. document.getElementById("controls").style.display="none";
  2625. document.getElementById("vcontr").style.display="none";
  2626.  
  2627. }
  2628. }
  2629.  
  2630. function makecrd(){
  2631. if (noaccess){return;}
  2632. if (data.summary_card_image==""){return;}
  2633. var newelem=document.createElement('img');
  2634. newelem.src=data.summary_card_image;
  2635. newelem.className="profplayer";
  2636. newelem.id="profimg";
  2637. newelem.style.height="480px";
  2638. newelem.style.maxWidth="854px";
  2639. document.querySelector('[data-testid="room-bio-tab-contents"]').appendChild(newelem);
  2640. }
  2641.  
  2642. function makeimg(){
  2643. var newelem=document.createElement('img');
  2644. newelem.src="https://jpeg.live.mmcdn.com/minifwap/"+roomname+".jpg";
  2645. newelem.className="profplayer";
  2646. newelem.id="profimg";
  2647. newelem.style.height="270px";
  2648. newelem.style.width="480px";
  2649. document.querySelector('[data-testid="room-bio-tab-contents"]').appendChild(newelem);
  2650. }
  2651.  
  2652. function makejpgplayer(){
  2653. var newelem=document.createElement('canvas');
  2654. newelem.width="854";
  2655. newelem.height="480";
  2656. newelem.id="profjpgimg";
  2657. newelem.style.display="none";
  2658. document.querySelector('[data-testid="room-bio-tab-contents"]').appendChild(newelem);
  2659. pimg.addEventListener("load",regetimgprof);
  2660. pimg.addEventListener("error",errorimgprof);
  2661. pimg.crossOrigin = "Anonymous";
  2662. n=new Date().getTime();
  2663. pimg.src = "https://jpeg.live.mmcdn.com/stream?room="+roomname+"&f="+n;
  2664. var canvas=document.querySelector('canvas');
  2665. stream = canvas.captureStream ? canvas.captureStream() : canvas.mozCaptureStream();
  2666. makevidplayer();
  2667. document.querySelector('video').srcObject=stream;
  2668. document.querySelector('video').play();
  2669. }
  2670.  
  2671. function errorimgprof(){
  2672. if (gojpg){return;}
  2673. recstop();
  2674. setTimeout(function(){getnewhls(true,false,1);},2000);
  2675. }
  2676.  
  2677. function regetimgprof(){
  2678. var lt=new Date().getTime()-n;
  2679. if (lt>180){lt=180;}
  2680. if ((document.visibilityState!="visible")&&(!recording)){
  2681. setTimeout(regetimgprof,2000);
  2682. }else{
  2683. var canvas = document.querySelector('canvas');
  2684. canvas.getContext('2d').drawImage(pimg, 0, 0, pimg.width, pimg.height);
  2685. setTimeout(function(){n=new Date().getTime();pimg.src = "https://jpeg.live.mmcdn.com/stream?room="+roomname+"&f="+n;}, 200-lt);
  2686. }
  2687. }
  2688.  
  2689. function makevidplayer(){
  2690. if(document.getElementById("tabs_content_container")){
  2691. document.getElementById("tabs_content_container").style.minHeight=parseInt(0.562*window.innerWidth-5)+"px";
  2692. }
  2693. var vidobserver=new MutationObserver(vidsize);
  2694. var vidobserverConfig ={attributes : true, attributeFilter : ['style'] };
  2695. var control=localStorage.getItem("videoControls");
  2696. var newdivelem=document.createElement('div');
  2697. newdivelem.className="profdivplayer";
  2698. newdivelem.style.width=vidwidth+"px";
  2699. newdivelem.id="profplayer";
  2700. var newelem=document.createElement('video');
  2701. newelem.controls=true;
  2702. if (control.indexOf("true")!=-1){newelem.muted=true;}
  2703. var volume=control.split(":")[1].split(",")[0];
  2704. newelem.volume=volume/100;
  2705. newelem.poster="https://jpeg.live.mmcdn.com/stream?room="+roomname+"&f="+ new Date().getTime();
  2706. newelem.height=parseInt(vidwidth*0.562)+1;
  2707. newelem.id="profvid";
  2708. newdivelem.appendChild(newelem);
  2709. document.querySelector('[data-testid="room-bio-tab-contents"]').appendChild(newdivelem);
  2710. vidobserver.observe(document.getElementById("profplayer"), vidobserverConfig);
  2711. if(!document.querySelector('canvas')){
  2712. document.addEventListener("visibilitychange",vidpause);
  2713. }
  2714. document.getElementById("vcontr").style.display="block";
  2715. }
  2716.  
  2717. function vidsize(){
  2718. vidwidth=parseInt(document.getElementById("profplayer").style.width);
  2719. if (vidwidth<80){vidwidth=80;document.getElementById("profplayer").style.width=vidwidth+"px";}
  2720. if (vidwidth>window.innerWidth-75){vidwidth=window.innerWidth-75;document.getElementById("profplayer").style.width=vidwidth+"px";}
  2721. document.getElementById("profvid").height=parseInt(vidwidth*0.562)+1;
  2722. }
  2723.  
  2724. function startvid(){
  2725. var restarting=false;
  2726. if(document.visibilityState!="visible"){return;}
  2727. document.getElementById("vcontr").style.display="block";
  2728. var video=document.getElementsByTagName('video')[0];
  2729. video.poster="https://jpeg.live.mmcdn.com/stream?room="+roomname+"&f="+ new Date().getTime();
  2730. hls.loadSource(videoSrc);
  2731. hls.attachMedia(video);
  2732. hls.on(Hls.Events.MEDIA_ATTACHED, function(){video.play();});
  2733. hls.on(Hls.Events.ERROR, function (event, data) {
  2734. if (restarting){return;}
  2735. if (fatalerror==0){setTimeout(function(){fatalerror=0;}, 15000);}
  2736. fatalerror++;
  2737. if (fatalerror < 6){
  2738. if ((data.fatal==true)||(data.type="networkError")){
  2739. hls.detachMedia();
  2740. restarting=true;
  2741. setTimeout(function(){getnewhls(true,false,1);},2000);
  2742. }
  2743. }else{
  2744. gojpg=true;
  2745. hls.detachMedia();
  2746. restarting=true;
  2747. createimage();
  2748. }
  2749. });
  2750. }
  2751.  
  2752. function vidpause(){
  2753. if (recording){return;}
  2754. if (document.hidden){
  2755. hls. stopLoad();
  2756. hls.detachMedia();
  2757. }else{
  2758. if (!document.hidden){
  2759. startvid();
  2760. }
  2761. }
  2762. }
  2763.  
  2764. function recstop(){
  2765. if (!recording){return;}
  2766. mediaRecorder.stop();
  2767. }
  2768. function recstart(){
  2769. if (recording){
  2770. if (!recpause){
  2771. mediaRecorder.pause();
  2772. recpause=true;
  2773. document.getElementById("recbut").style.color="#990000";
  2774. setTimeout(function(){document.getElementById("recbut").style.color="#990000";},400);
  2775. return;
  2776. }
  2777. mediaRecorder.resume();
  2778. recpause=false;
  2779. return;
  2780. }
  2781. recname=roomname+"_"+new Date().toISOString().split(".")[0]+"GMT";
  2782. recording=true;
  2783. document.getElementById("vcontr").style.cursor="not-allowed";
  2784. document.getElementById("vcontr2").style.cursor="not-allowed";
  2785. document.getElementById("recbut").style.color="#990000";
  2786. if (!document.querySelector('canvas')){
  2787. var video=document.querySelector('video');
  2788. stream = video.captureStream ? video.captureStream() : video.mozCaptureStream();
  2789. if (!video.captureStream) {
  2790. var ctx = new AudioContext();
  2791. var dest = ctx.createMediaStreamSource(stream);
  2792. dest.connect(ctx.destination);
  2793. }
  2794. }
  2795. mediaRecorder = new MediaRecorder(stream);
  2796. mediaRecorder.onstop = startDownload;
  2797. mediaRecorder.ondataavailable = handleDataAvailable;
  2798. try {
  2799. mediaRecorder.start(1000);
  2800. } catch (e) {
  2801. document.getElementById("recbut").style.color="white";
  2802. recording=false;
  2803. recpause=false;
  2804. }
  2805. }
  2806. function handleDataAvailable(event) {
  2807. document.getElementById("recbut").style.color="#990000";
  2808. if (event.data && event.data.size > 0) {
  2809. setTimeout(function(){document.getElementById("recbut").style.color="white";},300);
  2810. recordedBlobs.push(event.data);
  2811. }
  2812. }
  2813. function startDownload() {
  2814. recpause=false;
  2815. recording=false;
  2816. document.getElementById("vcontr").style.cursor="pointer";
  2817. document.getElementById("vcontr2").style.cursor="pointer";
  2818. if (!document.querySelector('canvas')){
  2819. removevidplayer();
  2820. document.getElementById("controls").style.display="block";
  2821. createimage();
  2822. }
  2823. var blob = new Blob(recordedBlobs, {type: 'video/webm codecs="vp9" opus'});
  2824. var url = window.URL.createObjectURL(blob);
  2825. var a = document.createElement('a');
  2826. a.style.display = 'none';
  2827. a.href = url;
  2828. a.download = recname+'.webm';
  2829. document.body.appendChild(a);
  2830. a.click();
  2831. setTimeout(function(){
  2832. document.body.removeChild(a);
  2833. window.URL.revokeObjectURL(url);
  2834. recordedBlobs = [];
  2835. }, 100);
  2836. }
  2837.  
  2838. function buildprofnote(){
  2839. var subbutraw="<span id='profsubmit' style='color: rgb(255, 255, 255); background: rgb(244, 115, 33); font-family: UbuntuMedium, Helvetica, Arial, sans-serif; font-size: 12px; padding: 4px 10px 5px; position: relative; left: 120px; float: left; border-radius: 4px; cursor: pointer;'>Save</span>";
  2840. wprof("",'<div width="200px" id="profnote" style="display:none"><a href=# id="profcancel">Cancel</a>'+subbutraw+'</div>');
  2841. wprof("Personal notes:","<textarea id='proftext' spellcheck='false' placeholder='Enter notes about this user (only seen by you)'></textarea>");
  2842. document.getElementById("proftext").value=opennote;
  2843. document.getElementById("proftext").addEventListener("input",profopenbutton);
  2844. document.getElementById("profcancel").addEventListener("click",profclosebutton);
  2845. document.getElementById("profsubmit").addEventListener("click",profsavenote);
  2846. }
  2847.  
  2848. function profsavenote(){
  2849. var notetext=document.getElementById("proftext").value;
  2850. var url=domain+"api/notes/for_user/"+roomname+"/";
  2851. var csrftoken= readCookie("csrftoken");
  2852. var data = new FormData();
  2853. data.append( "text", notetext );
  2854. fetch(url,
  2855. {
  2856. method: "POST",
  2857. headers: {
  2858. 'x-csrftoken': csrftoken,
  2859. 'x-requested-with': 'XMLHttpRequest'
  2860. },
  2861. referrer: domain+roomname+"/",
  2862. body: data
  2863. }).then(profaftersave);
  2864. }
  2865.  
  2866. function profaftersave(){
  2867. opennote=document.getElementById("proftext").value;
  2868. profclosebutton();
  2869. }
  2870.  
  2871. function profopenbutton(){
  2872. document.getElementById("profnote").style.display="block";
  2873. document.getElementById("proftext").value=document.getElementById("proftext").value.replace("$"," "+new Date().toLocaleDateString()+" ");
  2874. if(opennote==document.getElementById("proftext").value){
  2875. profclosebutton();
  2876. }
  2877. }
  2878.  
  2879. function profclosebutton(){
  2880. document.getElementById("profnote").style.display="none";
  2881. document.getElementById("proftext").value=opennote;
  2882. }
  2883.  
  2884. function wprof(col1,col2){
  2885. var container=document.getElementsByClassName("BioContents")[0];
  2886. var newtr=document.createElement('tr');
  2887. newtr.setAttribute("style", "font-size: 14px; font-weight: normal; line-height: 15px; vertical-align: top; text-align: left;");
  2888. newtr.setAttribute("name", "info");
  2889. var newtd=document.createElement('td');
  2890. newtd.setAttribute("style", "padding-bottom: 9px; font-family: UbuntuMedium, Arial, Helvetica, sans-serif; height: 16px;");
  2891. newtd.className="label";
  2892. var newspan=document.createElement('span');
  2893. newspan.className="defaultColor";
  2894. newspan.innerHTML=col1;
  2895. newtd.appendChild(newspan);
  2896. var newtd2=document.createElement('td');
  2897. newtd2.setAttribute("style", "font-size: 14px; line-height: 16px; font-family: UbuntuRegular, Arial, Helvetica, sans-serif;");
  2898. newtd2.className="contentText";
  2899. newtd2.innerHTML=col2;
  2900. newtr.appendChild(newtd);
  2901. newtr.appendChild(newtd2);
  2902. var referenceNode=container.getElementsByTagName("table")[0];
  2903. referenceNode.insertBefore(newtr, referenceNode.getElementsByTagName("tr")[2]);
  2904. }
  2905.  
  2906. function newinfo(){
  2907. if (fetching!==0){alert("Slow down !");return;}
  2908. if(document.getElementById("rulespop")){document.getElementById("rulespop").style.display="none";}
  2909. var tags=document.getElementsByName("info");
  2910. for(i=tags.length-1;i>=0;i--){
  2911. tags[i].remove();
  2912. }
  2913. info(true);
  2914. }
  2915.  
  2916. function cleaninit(){
  2917. var p=0;
  2918. var maxoke="";
  2919. var attr="";
  2920. var tags=document.querySelectorAll('[rel="nofollow"]');
  2921. for (n=0; n<tags.length; n++){
  2922. if (tags[n].style.position){
  2923. if (tags[n].style.position=="fixed"){
  2924. tags[n].style.position="absolute";
  2925. }
  2926. if (tags[n].style.position.indexOf("var")!=-1){
  2927. tags[n].style.position="absolute";
  2928. }
  2929. if (tags[n].style.position.indexOf("absolute")!=-1){
  2930. if (tags[n].getAttribute("style").indexOf("!important")!=-1){
  2931. attr=tags[n].getAttribute("style");
  2932. attr=attr.split("!important").join("");
  2933. tags[n].setAttribute("style",attr);
  2934. }
  2935. tags[n].classList.add("profpos");
  2936. p++;
  2937. }
  2938. }
  2939. if (tags[n].style.marginTop){
  2940. maxoke=-30;
  2941. if(tags[n].style.marginTop.indexOf("px")!=-1){maxoke=-200;}
  2942. if (parseFloat(tags[n].style.marginTop)<maxoke){
  2943. if (tags[n].getAttribute("style").indexOf("!important")!=-1){
  2944. attr=tags[n].getAttribute("style");
  2945. attr=attr.split("!important").join("");
  2946. tags[n].setAttribute("style",attr);
  2947. }
  2948. tags[n].classList.add("profmar");
  2949. p++;
  2950. }
  2951. }
  2952. if (tags[n].style.margin){
  2953. maxoke=-30;
  2954. if(tags[n].style.margin.split(" ")[0].indexOf("px")!=-1){maxoke=-200;}
  2955. if (parseFloat(tags[n].style.margin)<maxoke){
  2956. if (tags[n].getAttribute("style").indexOf("!important")!=-1){
  2957. attr=tags[n].getAttribute("style");
  2958. attr=attr.split("!important").join("");
  2959. tags[n].setAttribute("style",attr);
  2960. }
  2961. tags[n].classList.add("profmar");
  2962. p++;
  2963. }
  2964. }
  2965. if (tags[n].style.cursor){
  2966. if (tags[n].getAttribute("style").indexOf("!important")!=-1){
  2967. attr=tags[n].getAttribute("style");
  2968. attr=attr.split("!important").join("");
  2969. tags[n].setAttribute("style",attr);
  2970. }
  2971. tags[n].classList.add("profcur");
  2972. p++;
  2973. }
  2974. }
  2975. document.getElementById("clean").style.display="none";
  2976. if (p!==0){
  2977. document.getElementById("clean").style.display="block";
  2978. cleanup();
  2979. }
  2980. }
  2981.  
  2982. function cleancookie(){
  2983. if (localStorage.getItem("pclean")){
  2984. localStorage.removeItem("pclean");
  2985. }else{
  2986. localStorage.setItem("pclean", "foo");
  2987. }
  2988. cleanup();
  2989. }
  2990.  
  2991. function cleanup(){
  2992. var claction=!localStorage.getItem("pclean");
  2993. if (claction){
  2994. document.getElementById("clean").innerHTML= "CLEAN PROFILE = ON&nbsp;";
  2995. var style = document.createElement('style');
  2996. style.setAttribute('type', 'text/css');
  2997. style.id="profstyle";
  2998. style.textContent = ".profpos {display:none !important} .profmar {margin-top:0px !important;} .profcur{cursor:default !important }";
  2999. document.getElementsByTagName('head')[0].appendChild(style);
  3000. }else{
  3001. document.getElementById("clean").innerHTML= "CLEAN PROFILE = OFF";
  3002. if (document.getElementById("profstyle")!=null){
  3003. document.getElementById("profstyle").remove();
  3004. }
  3005. }
  3006. }
  3007.  
  3008. function linkfix(){
  3009. var bioarea= document.getElementsByClassName('BioContents')[0];
  3010. var tags = bioarea.getElementsByTagName('a');
  3011. for (i=0; i<tags.length; i++){
  3012. if (tags[i].href.indexOf("campaign=")!=-1){
  3013. tags[i].href=tour;
  3014. }
  3015. if (tags[i].href.indexOf('?url=') != -1){
  3016. var linkout=decodeURIComponent(tags[i].href).split("?url=")[1];
  3017. if (linkout.indexOf("campaign=")!=-1){
  3018. linkout=tour;
  3019. }
  3020. tags[i].href=linkout;
  3021. }
  3022. }
  3023. if(document.querySelector('[data-testid="sign-up-tab"]')){
  3024. document.querySelector('[data-testid="sign-up-tab"]').href=tour;
  3025. }
  3026. }
  3027.  
  3028. function collectiondownload(){
  3029. document.getElementById("main").addEventListener("click", collectiondownload2);
  3030. collectiondownload2();
  3031. }
  3032.  
  3033. function collectiondownload2(){
  3034. setTimeout(function(){collectiondownload3();}, 2000);
  3035. }
  3036.  
  3037. function collectiondownload3(){
  3038. if(document.getElementsByTagName("video").length>0){
  3039. if(document.getElementsByTagName("video")[0].src){
  3040. if(!document.getElementById("link")){
  3041. var newelem=document.createElement('a');
  3042. newelem.id="link";
  3043. newelem.style.position="relative";
  3044. newelem.style.left="250px";
  3045. newelem.style.top="5px";
  3046. newelem.href= document.getElementsByTagName("video")[0].src;
  3047. newelem.target="_blank";
  3048. newelem.innerHTML="Right click, save to disk.";
  3049. newelem.style.backgroundColor="white";
  3050. newelem.style.marginLeft="20px";
  3051. document.getElementsByClassName("createdAt")[0].parentNode.appendChild(newelem);
  3052. }
  3053. }
  3054. }
  3055. }
  3056.  
  3057. function savedprvdownload(){
  3058. setTimeout(function(){savedprvdownload3();}, 2000);
  3059. }
  3060.  
  3061. function savedprvdownload3(){
  3062. var newelem=document.createElement('a');
  3063. newelem.href= document.getElementsByTagName("video")[0].src;
  3064. newelem.target="_blank";
  3065. newelem.innerHTML="Right click, save to disk.<br>";
  3066. newelem.style.backgroundColor="white";
  3067. newelem.style.marginLeft="20px";
  3068. document.getElementById("tsRecordedShowPlayer").appendChild(newelem);
  3069. }
  3070.  
  3071. function passwordfollow(){
  3072. setTimeout(function(){
  3073. var unfollow=document.querySelector('[data-testid="unfollow-button"]');
  3074. var follow=document.querySelector('[data-testid="follow-button"]');
  3075. if (unfollow.style.display=="none"){
  3076. follow.parentNode.parentNode.style.display="block";
  3077. follow.style.display="block";
  3078. }
  3079. unfollow.addEventListener("click", function(){setTimeout(function(){document.location.reload();}, 500);} );
  3080. follow.addEventListener("click", function(){setTimeout(function(){document.location.reload();}, 500);} );
  3081. }, 1000);
  3082. var newelem=document.createElement('div');
  3083. newelem.className="BioContents";
  3084. var newtable=document.createElement('table');
  3085. newelem.appendChild(newtable);
  3086. var newtr=document.createElement('tr');
  3087. newtable.appendChild(newtr);
  3088. newtr=document.createElement('tr');
  3089. newelem.style.position="relative";
  3090. newelem.style.float="left";
  3091. newtable.appendChild(newtr);
  3092. document.getElementsByClassName("defaultColor")[0].appendChild(newelem);
  3093. wprof ("DM:","<a href='"+domain+"dm/"+roomname+"/' id='dmpop'>Open window</a>");
  3094. wprof("Video:",'<div id="rstatus"></div>');
  3095. wprof("Video status:","<a href=# id='hls'>Update status</a>");
  3096. wprof("Check:","Off <input type='range' id='pwalrm' min=0 max=1 value=0 style='width: 35px;height:auto;cursor: pointer'> On || Enter the room if you get acces.");
  3097. document.getElementById("pwalrm").addEventListener("change",setpwalrm);
  3098. getnewhls(true,false);
  3099. document.getElementById("hls").addEventListener("click",function(){getnewhls(true,true);});
  3100. document.getElementById("dmpop").addEventListener("click", function(event){opendm3(this);event.stopPropagation();event.preventDefault();return false;});
  3101. getnotes();
  3102. document.getElementsByClassName("tooltip")[0].innerHTML="If follow does not work this room banned your region or gender.";
  3103. document.getElementById("tsContent").style.minHeight="400px";
  3104. }
  3105.  
  3106. function setpwalrm(){
  3107. if (document.getElementById("pwalrm").value==0){return;}
  3108. if (alarmrun==false){
  3109. alarmrun=true;
  3110. checkpwalarm();
  3111. }
  3112. }
  3113.  
  3114. function checkpwalarm(){
  3115. setTimeout(function(){
  3116. if(document.getElementById("pwalrm").value==0){alarmrun=false;return;}
  3117. var url=domain+"api/chatvideocontext/"+roomname+"/";
  3118. fetch(url,{credentials: "same-origin"}).then(
  3119. function(response) {
  3120. if (response.status == 200){
  3121. forceopen(roomname);
  3122. return;
  3123. }
  3124. checkpwalarm();
  3125. });
  3126. },60000);
  3127. }
  3128.  
  3129. function forceopen(room){
  3130. window.focus();
  3131. document.location.href=domain+room;
  3132. }
  3133.  
  3134. function opendm3(that){
  3135. window.open(that.href,'DMpop','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=800,height=800');
  3136. }
  3137.  
  3138. function bannedroom(){
  3139. var url=domain+"api/chatvideocontext/"+roomname+"/";
  3140. fetch(url,{method: 'HEAD', credentials: "omit"}).then(
  3141. function(response) {
  3142. if (response.status !== 200){
  3143. noaccess=true;
  3144. setprofile();
  3145. return;
  3146. }else{
  3147. document.location.href=domain+'p/'+yourname+'?tab=bio&model='+roomname;
  3148. return;
  3149. }
  3150. });
  3151. }
  3152.  
  3153. function setprofile(){
  3154. document.getElementsByClassName("BaseRoomContents")[0].style.minHeight=parseInt(0.562*window.innerWidth-5)+"px";
  3155. var newelem=document.createElement('div');
  3156. newelem.style.width="100%";
  3157. newelem.style.height="1px";
  3158. newelem.setAttribute('data-testid', 'room-bio-tab-contents');
  3159. document.getElementsByClassName("BaseRoomContents")[0].appendChild(newelem);
  3160. newelem=document.createElement('div');
  3161. newelem.style.margin="14px 14px";
  3162. document.getElementsByClassName("BaseRoomContents")[0].appendChild(newelem);
  3163. newelem=document.createElement('div');
  3164. newelem.className="BioContents";
  3165. newelem.style.margin="20px";
  3166. var newtable=document.createElement('table');
  3167. newelem.appendChild(newtable);
  3168. var newtr=document.createElement('tr');
  3169. newtable.appendChild(newtr);
  3170. newtr=document.createElement('tr');
  3171. newtable.appendChild(newtr);
  3172. document.getElementsByClassName("BaseRoomContents")[0].appendChild(newelem);
  3173. putinlinks();
  3174. makevidcontrol();
  3175. getnewhls(true,false,1);
  3176. setTimeout(function(){
  3177. if (room_status!="public"){
  3178. if(room_status.indexOf("watching")==-1){
  3179. document.getElementById("vcontr").style.display="none";
  3180. document.getElementById("controls").style.display="none";
  3181. }
  3182. }
  3183. },1000);
  3184. }
  3185.  
  3186. function putinlinks(){
  3187. wprof("","<a href=# id=moreinfo>Click here to search for more info.</a>");
  3188. document.getElementById("moreinfo").addEventListener("click",moreinfo);
  3189. wprof("Find:","<a href='https://camgirlfinder.net/models?m="+roomname+"&p=cb&g=a' rel=noreferrer target='_new'>Open in camgirlfinder</a>");
  3190. wprof("Statistics:","<a href='https://statbate.com/search/1/"+roomname+"' rel=noreferrer target='_new'>Open in statbate</a>");
  3191. wprof("Schedule:","<a href='https://www.cbhours.com/user/"+roomname+".html' rel=noreferrer target='_new'>Open in cbhours</a>");
  3192. wprof("Video status:","<a href=# id='hls'>Update status</a>");
  3193. document.getElementById("hls").addEventListener("click",function(){getnewhls(true,true,1);});
  3194. wprof("Video:",'<div id="rstatus">'+room_status+'</div>');
  3195. wprof("Nationality:","<span id='flaginfo'>wait....</span>");
  3196. wprof("Region:","<span id='regioninfo'>wait....</span>");
  3197. setTimeout(function(){
  3198. getregion(false);
  3199. },1000);
  3200. wprof('<font color=#CC0000 id="vstatus"></font>',"");
  3201. if(login){
  3202. getnotes();
  3203. }
  3204. }
  3205. function moreinfo(){
  3206. if (room_status!="public"){
  3207. document.getElementById("moreinfo").innerHTML="Room is not public.";
  3208. setTimeout(function(){document.getElementById("moreinfo").innerHTML="Click here to search for more info.";},3000);
  3209. return;
  3210. }
  3211. document.getElementById("moreinfo").removeEventListener("click",moreinfo);
  3212. document.getElementById("moreinfo").innerHTML="Please wait....";
  3213. var dataurl=domain+"affiliates/api/onlinerooms/?format=json&wm=DEieF";
  3214. fetch(dataurl,{credentials: "omit",referrerPolicy: "no-referrer"}).then(
  3215. function(response) {
  3216. if (response.status !== 200){
  3217. document.getElementById("moreinfo").innerHTML="Error reading roomlist.";
  3218. return;
  3219. }
  3220. response.json().then(function(data) {
  3221. for (n=0; n<data.length; n++){
  3222. if (data[n].username==roomname){
  3223. wprof("Gender:",data[n].gender);
  3224. wprof("Given location:",data[n].location);
  3225. if (data[n].country !=""){
  3226. if (document.getElementById("flaginfo").innerHTML!=data[n].country){
  3227. wprof("Nationality:",data[n].country);
  3228. }
  3229. }
  3230. wprof("Room topic:","<div style='width:450px;height:auto'>"+data[n].room_subject+"</div>");
  3231. wprof("Spoken languages:",data[n].spoken_languages);
  3232. wprof("Name:", data[n].display_name);
  3233. wprof("Birthday:",data[n].birthday);
  3234. wprof("Age:",data[n].age);
  3235. wprof("Time online:",toTime(data[n].seconds_online));
  3236. wprof("Users in room:",data[n].num_users);
  3237. wprof("Followers:",data[n].num_followers);
  3238. document.getElementById("moreinfo").innerHTML="";
  3239. data="";
  3240. break;
  3241. }
  3242. }
  3243. if (n==data.length){
  3244. document.getElementById("moreinfo").innerHTML="No information found, user may no longer be in public or opt-out.";
  3245. setTimeout(function(){
  3246. document.getElementById("moreinfo").innerHTML="Click here to search for more info.";
  3247. document.getElementById("moreinfo").addEventListener("click",moreinfo);
  3248. },3000);
  3249. }
  3250. data="";
  3251. });
  3252. });
  3253. }
  3254. function toTime(seconds) {
  3255. var date = new Date(null);
  3256. date.setSeconds(seconds);
  3257. return date.toISOString().substr(11, 8).replace(":","h").replace(":","m")+"s";
  3258. }
  3259.  
  3260. function createCookie(name,value,days,cdomain){
  3261. var expires="";
  3262. if (cdomain){
  3263. cdomain=";domain=."+cdomain;
  3264. }else{
  3265. cdomain = "";
  3266. }
  3267. if (days) {
  3268. var date = new Date();
  3269. date.setTime(date.getTime()+(days*24*60*60*1000));
  3270. expires = "; expires="+date.toGMTString();
  3271. }
  3272. document.cookie = name+"="+value+expires+"; path=/"+cdomain;
  3273. }
  3274.  
  3275. function readCookie(name) {
  3276. var nameEQ = name + "=";
  3277. var ca = document.cookie.split(';');
  3278. for(i=0;i < ca.length;i++) {
  3279. var c = ca[i];
  3280. while (c.charAt(0)==' '){
  3281. c = c.substring(1,c.length);
  3282. }
  3283. if (c.indexOf(nameEQ) === 0){
  3284. return c.substring(nameEQ.length,c.length);
  3285. }
  3286. }
  3287. return null;
  3288. }
  3289.  
  3290. function eraseCookie(name,cdomain){
  3291. createCookie(name,"",-1,cdomain);
  3292. }
  3293.  
  3294. function rebuildbio(){
  3295. referenceNode=document.getElementsByClassName("BioContents")[0].getElementsByTagName("table")[0];
  3296. document.querySelector('[data-paction="RoomTabs"]').remove();
  3297. removebionode();
  3298. document.getElementsByClassName("editbio")[0].remove();
  3299. document.getElementsByClassName("tooltip defaultTooltipColor")[0].remove();
  3300. document.querySelector('[data-paction-name="ActiveRoom"]').innerHTML=tocap(roomname) + "'s Bio";
  3301. document.querySelector('[data-paction-name="ActiveRoom"]').title=tocap(roomname) + "'s Bio";
  3302. document.title=tocap(roomname) + "'s Bio";
  3303. ctitle=document.title;
  3304. getbiodata(true);
  3305. }
  3306.  
  3307. function tocap(name){
  3308. if (!name){return "";}
  3309. return name.charAt(0).toUpperCase()+name.slice(1);
  3310. }
  3311.  
  3312. function getbiodata(anon){
  3313. var cred="same-origin";
  3314. if (!anon){cred="omit";}
  3315. var url=domain+"api/biocontext/"+roomname;
  3316. fetch(url,{ credentials: cred,referrer: domain+roomname+"/"}).then(
  3317. function(response) {
  3318. if (response.status !== 200){
  3319. if (anon){
  3320. getbiodata(false);
  3321. return;
  3322. }
  3323. document.location.href=domain+roomname+"/";
  3324. return;
  3325. }
  3326. response.json().then(function(data) {
  3327. biodata=data;
  3328. buildbio();
  3329. afterrebuild();
  3330. });
  3331. });
  3332. }
  3333.  
  3334. function removebionode(){
  3335. if (referenceNode.getElementsByTagName("tr")[3]){
  3336. referenceNode.getElementsByTagName("tr")[3].remove();
  3337. removebionode();
  3338. }
  3339. }
  3340.  
  3341. function buildbio(){
  3342. referenceNode.getElementsByTagName("tr")[2].getElementsByTagName("span")[0].innerHTML="Real Name:";
  3343. referenceNode.getElementsByTagName("tr")[2].getElementsByTagName("td")[1].innerHTML=tocap(biodata.real_name);
  3344.  
  3345. var newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3346. newnode.getElementsByTagName("span")[0].innerHTML="Followers:";
  3347. newnode.getElementsByTagName("td")[1].innerHTML=biodata.follower_count;
  3348. referenceNode.appendChild(newnode);
  3349. if (biodata.display_birthday){
  3350. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3351. newnode.getElementsByTagName("span")[0].innerHTML="Birth Date:";
  3352. newnode.getElementsByTagName("td")[1].innerHTML=biodata.display_birthday;
  3353. referenceNode.appendChild(newnode);
  3354. }
  3355. if (biodata.display_age){
  3356. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3357. newnode.getElementsByTagName("span")[0].innerHTML="Age:";
  3358. newnode.getElementsByTagName("td")[1].innerHTML=biodata.display_age;
  3359. referenceNode.appendChild(newnode);
  3360. }
  3361. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3362. newnode.getElementsByTagName("span")[0].innerHTML="I Am";
  3363. newnode.getElementsByTagName("td")[1].innerHTML=tocap(biodata.sex)+" "+tocap(biodata.subgender);
  3364. referenceNode.appendChild(newnode);
  3365. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3366. newnode.getElementsByTagName("span")[0].innerHTML="Interested In:";
  3367. newnode.getElementsByTagName("td")[1].innerHTML=tocap(biodata.interested_in[0])+" "+tocap(biodata.interested_in[1])+" "+tocap(biodata.interested_in[2])+" "+tocap(biodata.interested_in[3]);
  3368. referenceNode.appendChild(newnode);
  3369. if (biodata.location){
  3370. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3371. newnode.getElementsByTagName("span")[0].innerHTML="Location:";
  3372. newnode.getElementsByTagName("td")[1].innerHTML=tocap(biodata.location);
  3373. referenceNode.appendChild(newnode);
  3374. }
  3375. if (biodata.time_since_last_broadcast){
  3376. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3377. newnode.getElementsByTagName("span")[0].innerHTML="Last Broadcast:";
  3378. newnode.getElementsByTagName("td")[1].innerHTML=biodata.time_since_last_broadcast;
  3379. referenceNode.appendChild(newnode);
  3380. }
  3381. if (biodata.languages){
  3382. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3383. newnode.getElementsByTagName("span")[0].innerHTML="Language(s):";
  3384. newnode.getElementsByTagName("td")[1].innerHTML=tocap(biodata.languages);
  3385. referenceNode.appendChild(newnode);
  3386. }
  3387. if (biodata.body_type){
  3388. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3389. newnode.getElementsByTagName("span")[0].innerHTML="Body Type:";
  3390. newnode.getElementsByTagName("td")[1].innerHTML=tocap(biodata.body_type);
  3391. referenceNode.appendChild(newnode);
  3392. }
  3393. if (biodata.smoke_drink){
  3394. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3395. newnode.getElementsByTagName("span")[0].innerHTML="Smoke / Drink:";
  3396. newnode.getElementsByTagName("td")[1].innerHTML=tocap(biodata.smoke_drink);
  3397. referenceNode.appendChild(newnode);
  3398. }
  3399. if (biodata.body_decorations){
  3400. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3401. newnode.getElementsByTagName("span")[0].innerHTML="Body Decorations:";
  3402. newnode.getElementsByTagName("td")[1].innerHTML=tocap(biodata.body_decorations);
  3403. referenceNode.appendChild(newnode);
  3404. }
  3405. if (biodata.social_medias[0]){
  3406. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3407. newnode.getElementsByTagName("span")[0].innerHTML="Social Media:";
  3408. newnode.getElementsByTagName("td")[1].innerHTML="Available on cam page.";
  3409. referenceNode.appendChild(newnode);
  3410. }
  3411. if (biodata.photo_sets[0]){
  3412. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3413. newnode.getElementsByTagName("span")[0].innerHTML="Photo/video:";
  3414. newnode.getElementsByTagName("td")[1].innerHTML="<a href='"+domain+"photo_videos/photoset/detail/"+roomname+"/"+biodata.photo_sets[0].id+"' target=_blank> Open in new tab.</a>";
  3415. referenceNode.appendChild(newnode);
  3416. }
  3417. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3418. newnode.getElementsByTagName("span")[0].innerHTML="About Me:";
  3419. newnode.getElementsByTagName("td")[1].innerHTML=biodata.about_me;
  3420. referenceNode.appendChild(newnode);
  3421. if (biodata.wish_list){
  3422. newnode=referenceNode.getElementsByTagName("tr")[2].cloneNode(true);
  3423. newnode.getElementsByTagName("span")[0].innerHTML="Wish List:";
  3424. newnode.getElementsByTagName("td")[1].innerHTML=biodata.wish_list;
  3425. referenceNode.appendChild(newnode);
  3426. }
  3427. }
  3428.  
  3429. function getnewhls(anon,clicked,next){
  3430. if (hlsfetching==true){return;}
  3431. hlsfetching=true;
  3432. var cred="same-origin";
  3433. if (!anon){cred="omit";}
  3434. var oldmsg=document.getElementById("hls").innerHTML;
  3435. if(clicked){
  3436. document.getElementById("hls").innerHTML="Copying....";
  3437. }else{
  3438. document.getElementById("hls").innerHTML="Checking....";
  3439. }
  3440. var url=domain+"get_edge_hls_url_ajax/";
  3441. var csrftoken= readCookie("csrftoken");
  3442. var edge="";
  3443. if (videoSrc!=""){
  3444. edge=videoSrc.split("/")[2];
  3445. }
  3446. var data = new FormData();
  3447. data.append( "room_slug", roomname );
  3448. if (next==1){
  3449. data.append( "bandwidth", "high" );
  3450. data.append( "current_edge", edge );
  3451. data.append( "exclude_edge", "" );
  3452. }
  3453. data.append( "csrfmiddlewaretoken", csrftoken );
  3454. fetch(url,{
  3455. credentials: cred,
  3456. method: "POST",
  3457. headers: {
  3458. 'x-csrftoken': csrftoken,
  3459. 'x-requested-with': 'XMLHttpRequest'
  3460. },
  3461. referrer: domain+roomname+"/",
  3462. body: data
  3463. }).then(function(response){
  3464. if (response.status !== 200) {
  3465. if (anon){
  3466. hlsfetching=false;
  3467. getnewhls(false,clicked,next);
  3468. return;
  3469. }
  3470. document.getElementById("rstatus").innerHTML="Error";
  3471. document.getElementById("hls").innerHTML=oldmsg;
  3472. hlsfetching=false;
  3473. return;
  3474. }
  3475. response.json().then(function(data){
  3476. document.getElementById("rstatus").innerHTML=data.room_status;
  3477. document.getElementById("hls").innerHTML=oldmsg;
  3478. roomstatus=data.room_status;
  3479. room_status=data.room_status;
  3480. videoSrc=data.url;//for player
  3481. if (videoSrc!=""){
  3482. if (cmaf){
  3483. videoSrc=videoSrc.replace(".m3u8","_sfm4s.m3u8");
  3484. videoSrc=videoSrc.replace("live-edge","live-fhls");
  3485. }
  3486. if (clicked){navigator.clipboard.writeText(videoSrc);}
  3487. }
  3488. hlsfetching=false;
  3489. if (next==1){createimage();}
  3490. if (next==2){testalarm2();}
  3491. });
  3492. });
  3493. }
  3494.  
  3495. function getregion(again){
  3496. if (localStorage.getItem("regloaded")){
  3497. for(i=0;i < region.length;i++) {
  3498. regioarray=JSON.parse(localStorage.getItem("region_"+region[i]));
  3499. if (regioarray.indexOf(roomname)!=-1){
  3500. document.getElementById("regioninfo").innerHTML=niceregion[i];
  3501. if (regioarray[regioarray.indexOf(roomname)+1].length==2){
  3502. document.getElementById("flaginfo").innerHTML=regioarray[regioarray.indexOf(roomname)+1];
  3503. }else{
  3504. document.getElementById("flaginfo").parentNode.parentNode.style.display="none";
  3505. }
  3506. return;
  3507. }
  3508. }
  3509. if ((room_status=="offline")||(room_status=="away")){
  3510. document.getElementById("regioninfo").parentNode.parentNode.style.display="none";
  3511. document.getElementById("flaginfo").parentNode.parentNode.style.display="none";
  3512. return;
  3513. }
  3514. if(!again){
  3515. loadregion();
  3516. return;
  3517. }
  3518. }else{
  3519. if(!again){
  3520. loadregion();
  3521. return;
  3522. }
  3523. }
  3524. document.getElementById("regioninfo").parentNode.parentNode.style.display="none";
  3525. document.getElementById("flaginfo").parentNode.parentNode.style.display="none";
  3526. }
  3527.  
  3528. function loadregion(){
  3529. regioarray=[];
  3530. if (localStorage.getItem("regloaded")=="foo"){
  3531. regioarray=JSON.parse(localStorage.getItem("region_"+region[rcount]));
  3532. }
  3533. getregiondata();
  3534. }
  3535.  
  3536. function getregiondata(){
  3537. var url=domain+"api/public/affiliates/onlinerooms/?limit=500&offset="+regoffset*500+"&region="+region[rcount]+"&wm=DEieF&client_ip=212.77.7.51";
  3538. fetch(url,{ credentials: "omit"}).then(
  3539. function(response) {
  3540. if (response.status !== 200) {
  3541. return;
  3542. }
  3543. response.json().then(function(data){
  3544. if (data.results != null){
  3545. var regiolist=data.results;
  3546. for (n=0; n<regiolist.length; n++){
  3547. var name=regiolist[n].username;
  3548. if (regioarray.indexOf(name)==-1){
  3549. var flag=regiolist[n].country;
  3550. regioarray.push(name);
  3551. if (flag.length==2){
  3552. regioarray.push(flag);
  3553. }
  3554. }
  3555. }
  3556. var pages=Math.ceil(data.count/500);
  3557. regoffset++;
  3558. if (regoffset!=pages){
  3559. getregiondata();
  3560. return;
  3561. }else{
  3562. regioarray.push("");
  3563. localStorage.setItem("region_"+region[rcount],JSON.stringify(regioarray));
  3564. rcount++;
  3565. regoffset=0;
  3566. if (rcount!=region.length){
  3567. loadregion();
  3568. }else{
  3569. rcount=0;
  3570. localStorage.setItem("regloaded","foo");
  3571. getregion(true);
  3572. }
  3573. }
  3574. }
  3575. });
  3576. });
  3577. }
  3578.  
  3579.  
  3580. })();