YLHBOTv2RV

YouLikeHits Subscriber BOT

目前為 2019-12-01 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         YLHBOTv2RV
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  YouLikeHits Subscriber BOT
// @author       Moba Voice
// @match        https://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
//https://www.youlikehits.com/subyoutube.php?id=1267014&rand=0.46500547988424557
    // Your code here...

    var URL = window.location.href;
    console.log(URL);
    if(URL.includes("https://www.youlikehits.com/")){
	var bodyelem = document.createElement('div');
	bodyelem.style.cssText = 'left:120px;position:fixed;top:0;z-index:99999;background:#F6F6F6;width:347px;height:200px;border-radius:6px;box-shadow: 0px 0px 14px 0px black;';

	var htmlelems = '<a href="https://www.youtube.com/channel/UCPPSLCXcfp9WhEeG5IhISCQ"><img src="https://yt3.ggpht.com/a/AGF-l7_yyYELTZ68WvsjUDesn8ezezJJKf1FMNs7jQ=s900-c-k-c0xffffffff-no-rj-mo" style="'+
'    position: absolute;'+
'    width: 40px;'+
'    z-index: 99999;'+
'    border-radius: 52%;'+
'    left: 10px;'+
'    top: 8px;'+
'"></a>'+'<style>  '  +
 '   		html {  '  +
 '   			height:10px;  '  +
 '   		}  '  +
 '   		body {  '  +
 '   			margin:0;  '  +
 '   			padding:0;  '  +
 '   			position:relative;  '  +
 '   		}  '  +
 '   		*{  '  +
 '   			box-sizing:border-box;  '  +
 '   		}  '  +
 '   		#lblpoints:hover {  '  +
 '   			color:#1abc9c;  '  +
 '   		}  '  +
 '   	</style>  '  +
	'<div style="position:relative;width:100%;height: 60px;"><div style="position:relative;width:100%;height:100%;background: #067FA1;"><h1 style="left: 50%;font-size: 29px;top: 50%;color: #8FD8ED;position: absolute;transform: translate(-50%, -50%);letter-spacing: -3px;/* font-weight: 600; */">YOU<font color="white">LIKE</font>HITS<font color="white">BOT</font></h1></div>    <div style="    width: auto;    height: 127px;    background: #E3F1F4;    margin: 2%;    position: relative;    border-radius: 7px;">    <h2 style="width: 100%;height: auto;position: absolute;text-align: center;margin-top: 23px;font-weight: bold;font-size: 21px;color: #036C89;">Your Points</h2><h3 id="lblpoints" style="    position: absolute;    left: 50%;    transform: translate(-50%,-10%);    top: 10%;    font-size: 34px;">0,000</h3>        <button id="btnstart" style="    position: absolute;    bottom: 0;    width: 97%;    height: 32px;    color: white;    background: #237D32;    border: 0;    border-radius: 4px;    left: 50%;    transform: translateX(-50%);    margin-bottom: 8px;        -: 0px;">Start Bot</button></div></div><div style="'+
	'    width: 100%;'+
	'    position: absolute;'+
	'    bottom: -57px;'+
	'    "><textarea id="botstatus" col="1" row="2" style="'+
	'    width: 100%;'+
	''+
	'    '+
	'    font-size: 13px;'+
	'    padding: 8px;'+
	'    border-radius: 5px;'+
	'    outline: none;'+
	'    color: white;'+
	'    background: rgba(52, 52, 52, 0.52);'+
	'" readonly>Bot Status!</textarea>';


	bodyelem.innerHTML=htmlelems;

	document.body.appendChild(bodyelem);


$(document).ready(function()
{

			var tmpid= prompt("Please enter YTH ID", "1269000");
			if(tmpid==null) tmpid=1269000;
			var startvar = false;
			function LogsAppend(str){
				var today = new Date();
				var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
				document.getElementById("botstatus").value=document.getElementById("botstatus").value+" " + time +" " +str+"\r\n";
				document.getElementById("botstatus").scrollTop = document.getElementById("botstatus").scrollHeight;
			}
            let subsowner = window.open("https://www.youtube.com/channel/UCPPSLCXcfp9WhEeG5IhISCQ","","width=1,height=1");
			subsowner.blur();
			window.focus();

			//loop();
			function loop(){
				setTimeout(function(){
					if(startvar){
						start();
					}
				},1000)
				console.log(tmpid);
				tmpid++;
			}

			function start(){
				$.ajax({
					type: "GET",
					url: "subyoutube.php",
					data: "id="+tmpid+"&rand="+Math.random(),
					success: function(msg){
						LogsAppend("YLH Owner ID ["+tmpid+"]");
						try{
							var data = msg.match(/data: (.*\))/gm)[0];
							console.log(data);
							var vid = data.match(/(id=.*&o)/gm)[0];
							vid=vid.replace("id=","").replace("&o","");
							console.log(vid);
							LogsAppend("Getting Youtube Channel ID");
							LogsAppend("Found Youtube Channel ID ["+vid+"]");
							var owner = data.match(/(owner=.*&)/gm)[0];
							console.log(owner);
							owner=owner.replace("owner=","").replace("&","");
							var subsclick = msg.match(/checkclosed\('(.*=')/gm)[0];
							console.log(subsclick);
							subsclick=subsclick.replace("checkclosed(","");
							subsclick=subsclick.replace("'","").replace("'","");
							//checking(vid,Math.abs(owner));
							LogsAppend("YT waiting Subscribe!");
							checkclosed(subsclick,vid,owner);
						}catch(Exception){
							LogsAppend("YLH Owner["+tmpid+"] not found!");
							loop();
						}
					}
				});
			}
			function checkclosed(videoid,vid,owner) {
				//var win = window.open('subyoutuberender.php?page='+videoid+'','','status=0,toolbar=0,width=100,height=100,resizable=0,menubar=0,location=0,directories=0');
				var win = window.open('subyoutuberender.php?page='+videoid+'','',"width=100,height=100");
				var timer = setInterval(function() {
					if(win.closed) {
						LogsAppend("YLH Checking result!");
						clearInterval(timer);
						checking(vid,owner);
					}
				}, 1000);
			}
			function checking(vid,uid){
				$.ajax({
					type: "GET",
					url: "subyoutube.php?step=points",
					data: "id="+vid+"&owner="+uid+"&rand="+Math.random(),
					success: function(msg){
						console.log(msg);
						var res = msg.match(/(document\.getElementById\("currentpoints"\)\.innerHTML=.*')/gm);
						if(res==null){
							LogsAppend("YLH Did not receive reward!");
						}else{
							var totalpoints = res[0].replace('document.getElementById("currentpoints").innerHTML=','');
							totalpoints=totalpoints.replace("'","").replace("'","");
							var gotp = msg.match(/You got \d* Points/gm);
							LogsAppend("YLH " +gotp[0]);
							LogsAppend("YLH " +totalpoints+" Total Points!");
							document.getElementById("lblpoints").value=totalpoints;
						}
						loop();
					}
				});
			}
			$( "#btnstart" ).click(function() {
				startvar=(startvar)?false:true;
				$(this).text((startvar)?"Stop":"Start");
				$(this).css("background-color",((!startvar)?"#237D32":"#e74c3c"));
				if(startvar){
					document.getElementById("botstatus").value="";
					LogsAppend("YLHBot Started!");
					loop();
				}else{
					LogsAppend("YLHBot Stopped!");
				}
			});

});
    }else if(URL.includes("https://www.youtube.com/channel/")){
    try
    {
        var btnelem=document.getElementsByClassName('style-scope ytd-subscribe-button-renderer')[0];
        var subscribed = (btnelem.innerText.search("UNSUB")==-1)?false:true;
    }catch(Exception){window.close()}
    if(!subscribed){
        document.getElementsByClassName('style-scope ytd-subscribe-button-renderer')[0].click();
    }
    window.close();
    }



})();