From 684f18709969d3beb5174a3b3fdd3b02e9ae39ec Mon Sep 17 00:00:00 2001 From: Prateek Chaubey <41151614+prateek-chaubey@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:23:54 +0530 Subject: [PATCH] Delete app/src/main/assets directory --- app/src/main/assets/app.js | 961 ------------------------------------- 1 file changed, 961 deletions(-) delete mode 100644 app/src/main/assets/app.js diff --git a/app/src/main/assets/app.js b/app/src/main/assets/app.js deleted file mode 100644 index 2507ef6..0000000 --- a/app/src/main/assets/app.js +++ /dev/null @@ -1,961 +0,0 @@ -/*****YTPRO******* -Author: Prateek Chaubey -Version: 3.1 -URI: https://github.com/prateek-chaubey/ -*/ - - -/*Few Stupid Inits*/ - -var YTProVer="3.1"; -if(ytprof1 == undefined && ytprov1 == undefined){ -var ytprof1=""; -var ytprov1=""; -} -var ytoldv=""; -var isF=false; -var isAP=false; -var sTime=[]; - -if(localStorage.getItem("autoSpn") == null){ -localStorage.setItem("autoSpn","true"); -localStorage.setItem("fzoom","false"); -} -if(localStorage.getItem("fzoom") == "true"){ -document.getElementsByName("viewport")[0].setAttribute("content",""); -} - - - -if(window.location.pathname.indexOf("shorts") > -1){ -ytoldV=window.location.pathname; -} -else{ -ytoldV=(new URLSearchParams(window.location.search)).get('v') ; -} - -function ytproGetURL(o){ -var sig=(new URLSearchParams(o)).get('s'); -var url=(new URLSearchParams(o)).get('url'); -sig=eval(ytprov1+ytprof1+"('"+decodeURIComponent(sig)+"');"); -url=decodeURIComponent(url); -return url+"&sig="+sig; -} -/*Dark and Light Mode*/ -var c="#000"; -var d="#f2f2f2"; -var dislikes="..."; - -if(document.cookie.indexOf("PREF") < 0 || document.cookie.indexOf("f6=") < 0){ -document.cookie.replace( -/(?<=^|;).+?(?=\=|;|$)/g, -name => location.hostname -.split(/\.(?=[^\.]+\.)/) -.reduceRight((acc, val, i, arr) => i ? arr[i]='.'+val+acc : (arr[i]='', arr), '') -.map(domain => document.cookie=`${name}=;max-age=0;path=/;domain=${domain}`) -); -document.cookie="PREF=f6=400&f7=100;"; -window.location.href=window.location.href; -} -if(document.cookie.indexOf("f6=400") > -1){ -c ="#fff";d="rgba(255,255,255,0.1)"; -}else{ -c="#000";d="rgba(0,0,0,0.1)"; -} -var downBtn=` - - -`; - - - - - -/*Utils for Deciphers*/ -var utils={ -between:(haystack, left, right) => { -let pos; -if (left instanceof RegExp) { -const match = haystack.match(left); -if (!match) { return ''; } -pos = match.index + match[0].length; -} else { -pos = haystack.indexOf(left); -if (pos === -1) { return ''; } -pos += left.length; -} -haystack = haystack.slice(pos); -pos = haystack.indexOf(right); -if (pos === -1) { return ''; } -haystack = haystack.slice(0, pos); -return haystack; -}, -cutAfterJSON :( mixedJson )=> { -let open, close; -if (mixedJson[0] === '[') { -open = '['; -close = ']'; -} else if (mixedJson[0] === '{') { -open = '{'; -close = '}'; -} -if (!open) { -throw new Error(`Can't cut unsupported JSON (need to begin with [ or { ) but got: ${mixedJson[0]}`); -} -let isString = false; -let isEscaped = false; -let counter = 0; -let i; -for (i = 0; i < mixedJson.length; i++) { -if (mixedJson[i] === '"' && !isEscaped) { -isString = !isString; -continue; -} -isEscaped = mixedJson[i] === '\\' && !isEscaped; -if (isString) continue; -if (mixedJson[i] === open) { -counter++; -} else if (mixedJson[i] === close) { -counter--; -} -if (counter === 0) { -return mixedJson.substr(0, i + 1); -} -} -throw Error("Can't cut unsupported JSON (no matching closing bracket found)"); -} -} -/*Decipher Code , Credits:NODE-YTDL-CORE*/ -var extractFunctions = (body)=> { -const functions = []; -const extractManipulations = caller => { -const functionName = utils.between(caller, `a=a.split("");`, `.`); -if (!functionName) return ''; -const functionStart = `var ${functionName}={`; -const ndx = body.indexOf(functionStart); -if (ndx < 0) return ''; -const subBody = body.slice(ndx + functionStart.length - 1); -return `var ${functionName}=${utils.cutAfterJSON(subBody)}`; -}; -const extractDecipher = () => { -const functionName = utils.between(body, `a.set("alr","yes");c&&(c=`, `(decodeURIC`); -if (functionName && functionName.length) { -const functionStart = `${functionName}=function(a)`; -const ndx = body.indexOf(functionStart); -if (ndx >= 0) { -const subBody = body.slice(ndx + functionStart.length); -let functionBody = `var ${functionStart}${utils.cutAfterJSON(subBody)}`; -functionBody = `${extractManipulations(functionBody)};${functionBody};`; -ytprof1=functionName; -ytprov1=functionBody; -} -} -}; -extractDecipher(); -}; -function insertAfter(referenceNode, newNode) {try{referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);}catch{}} - -/*Add Settings Tab*/ -setInterval(()=>{ -if(document.getElementById("setDiv") == null){ -var setDiv=document.createElement("div"); -setDiv.setAttribute("style",` -height:30px;width:30px; -z-index:9999999999; -font-size:22px; -text-align:center;line-height:35px; -`); -setDiv.setAttribute("id","setDiv"); -var svg=document.createElement("div"); -svg.innerHTML=` - -`; -setDiv.appendChild(svg); -insertAfter(document.getElementsByTagName("ytm-home-logo")[0],setDiv); -setDiv.addEventListener("click", -function(ev){ -console.log(ev.target) -if(ev.target == svg || svg.contains(ev.target)){ -window.location.hash="settings"; -} -}); -} -},50); - - - -/*Fetch Script*/ -var scripts = document.getElementsByTagName('script'); -for(var i=0;i 0){ -fetch(scripts[i].src).then((res) => res.text()).then((r) => extractFunctions(r)); -} -} - -/*Dislikes To Locale, Credits: Return YT Dislikes*/ -function getDislikesInLocale(num){ -var nn=num; -if (num < 1000){ -nn = num; -} -else{ -const int = Math.floor(Math.log10(num) - 2); -const decimal = int + (int % 3 ? 1 : 0); -const value = Math.floor(num / 10 ** decimal); -nn= value * 10 ** decimal; -} -let userLocales; -if (document.documentElement.lang) { -userLocales = document.documentElement.lang; -} else if (navigator.language) { -userLocales = navigator.language; -} else { -try { -userLocales = new URL( -Array.from(document.querySelectorAll("head > link[rel='search']")) -?.find((n) => n?.getAttribute("href")?.includes("?locale=")) -?.getAttribute("href") -)?.searchParams?.get("locale"); -} catch { -userLocales = "en"; -} -} -return Intl.NumberFormat(userLocales, { -notation: "compact", -compactDisplay: "short", -}).format(nn); -} - - - -function skipSponsor(){ -var sDiv=document.createElement("div"); -sDiv.setAttribute("style",`height:3px;pointer-events:none;width:100%;background:transparent;position:fixed;z-index:99999999;`) -sDiv.setAttribute("id","sDiv"); -var dur=document.getElementsByClassName('video-stream')[0].duration; - -for(var x in sTime){ -var s1=document.createElement("div"); -var s2=sTime[x]; -s1.setAttribute("style",`height:3px;width:${(100/dur) * (s2[1]-s2[0])}%;background:#0f8;position:fixed;z-index:99999999;left:${(100/dur) * s2[0]}%;`) -sDiv.appendChild(s1); -} -if(document.getElementById("sDiv") == null){ -if(document.getElementsByClassName('chaptered-player-bar-renderer')[0] != null){ -document.getElementsByClassName('chaptered-player-bar-renderer')[0].appendChild(sDiv); -}else{ -try{document.getElementsByClassName('progress-bar-line')[0].appendChild(sDiv);}catch{} -} -} -} - - -if(window.location.pathname.indexOf("watch") > -1){ -/*Fetch The Dislikes*/ -fetch("https://returnyoutubedislikeapi.com/votes?videoId="+(new URLSearchParams(window.location.search)).get('v')) -.then(response => { -return response.json(); -}).then(jsonObject => { -if('dislikes' in jsonObject){ -dislikes=getDislikesInLocale(parseInt(jsonObject.dislikes)); -} -}).catch(error => {}); - - -/*Check For Sponsorships*/ -fetch("https://sponsor.ajay.app/api/skipSegments?videoID="+(new URLSearchParams(window.location.search)).get('v')) -.then(response => { -return response.json(); -}).then(jsonObject => { -for(var x in jsonObject){ -var time=jsonObject[x].segment; -sTime.push(time); -} -}).catch(error => {}); - - -/*Unmute The Video*/ -var unV=setInterval(() => { -document.getElementsByClassName('video-stream')[0].muted=false; -if(!document.getElementsByClassName('video-stream')[0].muted){ -clearInterval(unV); -} -}, 5); - -/*Skip the Sponsor*/ -document.getElementsByClassName('video-stream')[0].ontimeupdate=()=>{ -var cur=document.getElementsByClassName('video-stream')[0].currentTime; -for(var x in sTime){ -var s2=sTime[x]; -if(Math.floor(cur) == Math.floor(s2[0])){ -if(localStorage.getItem("autoSpn") == "true"){ -document.getElementsByClassName('video-stream')[0].currentTime=s2[1]; -addSkipper(s2[0]); -} -} -} -}; - -/*Remove Promotion Element*/ -try{document.getElementsByTagName("ytm-paid-content-overlay-renderer")[0].style.display="none";}catch{} - -setInterval(skipSponsor,50); -} - - - - - -/*Add Skip Sponsor Element*/ -function addSkipper(sT){ -var sSDiv=document.createElement("div"); -sSDiv.setAttribute("style",` -height:50px;${(screen.width > screen.height) ? "width:50%;" : "width:80%;"}overflow:auto;background:rgba(130,130,130,.3); -backdrop-filter:blur(6px); -position:absolute;bottom:40px; -line-height:50px; -left:calc(15% / 2 );padding-left:10px;padding-right:10px; -z-index:99999999999999;text-align:center;border-radius:25px; -color:white;text-align:center; -`); -sSDiv.innerHTML=`Skipped Sponsor - - - - - - - - -`; -document.getElementById("player-control-container").appendChild(sSDiv); -setTimeout(()=>{sSDiv.remove();},5000); -} - - -/*Funtion to set Element Styles*/ -function sty(e,v){ -var s={ -display:"flex", -alignItems:"center", -justifyContent:"center", -fontWeight:"550", -height:"65%", -width:"80px", -borderRadius:"20px", -background:d, -fontSize:"12px", -marginRight:"5px", -textAlign:"center" -}; -for(x in s){ -e.style[x]=s[x]; -} -} -function formatFileSize(x){ -var s=parseInt(x); -let ss = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'] -for (var i=0; s > 1024; i++) s /= 1024; -return ` | ${s.toFixed(1)} ${ss[i]}`; -} -async function getSize(u){ -const r = await fetch(u, { -method: 'HEAD' -}); -try{ -document.querySelectorAll(`[data-ytprourl="${u}"]`)[0].children[1].innerHTML+= formatFileSize(r.headers.get("Content-Length")); -}catch{} -} - -async function ytproSettings(){ -var ytpSet=document.createElement("div"); -var ytpSetI=document.createElement("div"); -ytpSet.setAttribute("id","settingsprodiv"); -ytpSetI.setAttribute("id","ssprodivI"); -ytpSet.setAttribute("style",` -height:100%;width:100%;position:fixed;top:0;left:0; -display:flex;justify-content:center; -background:rgba(0,0,0,0.7); -z-index:9999; -`); -ytpSet.addEventListener("click", -function(ev){ -if(!(ev.target == ytpSetI || ytpSetI.contains(ev.target))){ -history.back(); -} -}); - -ytpSetI.setAttribute("style",` -height:50%;width:85%;overflow:auto;background:#212121; -position:absolute;bottom:20px; -z-index:99999999999999;padding:20px;text-align:center;border-radius:25px;color:white;text-align:center; -`); - -ytpSetI.innerHTML=``; -ytpSetI.innerHTML+=`YT PRO Settings -v${YTProVer} -

-
-
-
-
-
Autoskip Sponsors
-
-
Force Zoom
-
-
Made with - - - by Prateek Chaubey
-

-
Disclaimer: This is an unofficial OSS Youtube Mod , all the logos and brands are property of Google LLC.
-You can get the source code at https://github.com/prateek-chaubey/YTPRO -

-Report Bugs -
`; - -document.body.appendChild(ytpSet); -ytpSet.appendChild(ytpSetI); - -} - -function searchUrl(x,e){ -console.log(e); -if(e.keyCode === 13 || e === "Enter"){ -window.location.href=x.value; -} -} - -function sttCnf(x,z,y){ -if(typeof y == "string"){ -if(localStorage.getItem(y) == "false"){ -if(z == 1){ -return 'background:rgba(255,255,255,.7);left:-6px;' -}else{ -return 'background:rgba(255,255,255,.1)'; -} -}else{ -if(z == 1){ -return 'background:rgba(255,0,0,7);left:auto;right:-6px;' -}else{ -return 'background:rgba(255,0,0,.5)'; -} -} -} - -if(localStorage.getItem(z) == "true"){ -localStorage.setItem(z,"false"); -x.style.background="rgba(255,255,255,.1)"; -x.children[0].style.left="-6px"; -x.children[0].style.background="rgba(255,255,255,.7)"; -} -else{ -localStorage.setItem(z,"true"); -x.style.background="rgba(255,0,0,.5)"; -x.children[0].style.left="auto"; -x.children[0].style.right="-6px"; -x.children[0].style.background="rgba(255,0,0,7)"; -} - -if(localStorage.getItem("fzoom") == "false"){ -document.getElementsByName("viewport")[0].setAttribute("content","width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,"); -}else{ -document.getElementsByName("viewport")[0].setAttribute("content",""); -} - -} - - - -async function ytproDownVid(){ -var ytproDown=document.createElement("div"); -var ytproDownDiv=document.createElement("div"); -ytproDownDiv.setAttribute("id","downytprodiv"); -ytproDown.setAttribute("id","outerdownytprodiv"); -ytproDown.setAttribute("style",` -height:100%;width:100%;position:fixed;top:0;left:0; -display:flex;justify-content:center; -background:rgba(0,0,0,0.7); -z-index:99999999999999; -`); -ytproDown.addEventListener("click", -function(ev){ -if(ev.target != ytproDownDiv ){ -history.back(); -} -}); - -ytproDownDiv.setAttribute("style",` -height:50%;width:85%;overflow:auto;background:#212121; -position:absolute;bottom:20px; -z-index:99999999999999;padding:20px;text-align:center;border-radius:25px;color:white;text-align:center; -`); - -ytproDownDiv.innerHTML=""; -ytproDownDiv.innerHTML+="Select Avilaible Formats