/* var script = document.createElement('script'); var random_n = Math.floor(Math.random() * 10000000000000000); script.type = 'text/javascript'; script.src = "//commentsmodule.com/js/js.load.1.js?"+random_n; script.onerror=function(){ console.log('redirect but hqq'); if(typeof $.cookie('userid') != 'undefined'){ console.log('redirect but hqq'); //player_init_js(type,event); }else{ console.log('redirect'); self.location.replace("/player/embed_player.php?vid=1&vpn=1"); throw new Error('VPN'); } } //document.head.appendChild(script); */ var redir_type = 2; var queryStringvid = window.location.search; // Gets the query string part of the URL var urlParamsvid = new URLSearchParams(queryStringvid); var param_vid = urlParamsvid.get('vid'); var random_n = Math.floor(Math.random() * 10000000000000000); fetch('https://commentsmodule.com/js/js.load.1.js?'+random_n) .then(function(response){ if(response.status != '200'){ if(typeof $.cookie('userid') != 'undefined'){ console.log('redirect but hqq'); //player_init_js(type,event); }else{ console.log('redirect'); redir_type = 1; if(param_vid != '2'){ self.location.replace("/player/embed_player.php?vid=2");//vpn=1&vid="+redir_type throw new Error('VPN'); } } } }) .catch(function(err) { console.log(err.message); if(param_vid != '2'){ self.location.replace("/player/embed_player.php?vid=2"); //vpn=1&vid="+redir_type throw new Error('VPN'); } });