1 line
6.4 KiB
JavaScript
1 line
6.4 KiB
JavaScript
|
var one="",two="",three="";function search(){var a=proxyserver();document.getElementById("buttlol").innerHTML="Searching",fetch(a+"/https://lookmovie.io/api/v1/movies/do-search/?q="+document.getElementById("movie").value).then(a=>{if(a.ok)return a.json();throw new Error("NETWORK RESPONSE ERROR")}).then(a=>{makeVisible(),clear(),document.getElementById("buttlol").innerHTML="Searched";var b=a.total;1==b&&(document.getElementById("2title").style.visibility="hidden",document.getElementById("2img").style.visibility="hidden",document.getElementById("3title").style.visibility="hidden",document.getElementById("3img").style.visibility="hidden",document.getElementById("1title").innerHTML=a.result[0].title+" "+a.result[0].year,document.getElementById("1img").src=a.result[0].poster,one=a.result[0].slug),2==b&&(document.getElementById("3title").style.visibility="hidden",document.getElementById("3img").style.visibility="hidden",document.getElementById("1title").innerHTML=a.result[0].title+" "+a.result[0].year,document.getElementById("1img").src=a.result[0].poster,one=a.result[0].slug,document.getElementById("2title").innerHTML=a.result[1].title+" "+a.result[1].year,document.getElementById("2img").src=a.result[1].poster,two=a.result[1].slug),1!==b&&2!==b&&(document.getElementById("1title").innerHTML=a.result[0].title+" "+a.result[0].year,document.getElementById("1img").src=a.result[0].poster,one=a.result[0].slug,document.getElementById("2title").innerHTML=a.result[1].title+" "+a.result[1].year,document.getElementById("2img").src=a.result[1].poster,two=a.result[1].slug,document.getElementById("3title").innerHTML=a.result[2].title+" "+a.result[2].year,document.getElementById("3img").src=a.result[2].poster,three=a.result[2].slug)}).catch(a=>console.error("FETCH ERROR:",a))}let input=document.getElementById("movie"),timeout=null;function makeVisible(){document.getElementById("1title").style.visibility="visible",document.getElementById("2title").style.visibility="visible",document.getElementById("3title").style.visibility="visible",document.getElementById("1img").style.visibility="visible",document.getElementById("2img").style.visibility="visible",document.getElementById("3img").style.visibility="visible"}function makeHidden(){document.getElementById("1title").style.visibility="hidden",document.getElementById("2title").style.visibility="hidden",document.getElementById("3title").style.visibility="hidden",document.getElementById("1img").style.visibility="hidden",document.getElementById("2img").style.visibility="hidden",document.getElementById("3img").style.visibility="hidden"}function clear(){document.getElementById("1title").innerHTML="No movie found",document.getElementById("2title").innerHTML="No movie found",document.getElementById("3title").innerHTML="No movie found",document.getElementById("1img").src="",document.getElementById("2img").src="",document.getElementById("3img").src="",one="",two="",three=""}function clickPress(a){13==a.keyCode&&search(),clearTimeout(timeout),timeout=setTimeout(function(){search()},300)}function Get(a){var b=new XMLHttpRequest;return b.open("GET",a,!1),b.setRequestHeader("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0"),b.send(null),b.responseText}function Test_get(a){try{var b=new XMLHttpRequest;return b.open("GET",a,!1),b.setRequestHeader("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0"),b.overrideMimeType("text/html"),b.send(null),b.setTimeout(2e3),1e4<b.responseText.length}catch{return!1}}function ooh(){var a=Math.max(window.screen.width,window.innerWidth);document.getElementById("video").style.visibility="visible",500>a?(document.getElementById("video").width=336,document.getElementById("video").height=189):750>a?(document.getElementById("video").width=640,document.getElementById("video").height=360):(document.getElementById("video").width=720,document.getElementById("video").height=405),document.getElementById("video").style.margin="0 auto",document.getElementById("video").style.display="block",document.getElemen
|