//ZXDL SCRIPT 2.0.0 - By ErikV7 - Light version
//SCRIPT AS JAVASCRIPT CODE
// ==UserScript==
// @name ZXDL
// @namespace http://zoox18.com/
// @version 2.1.0
// @description View and download private videos from ZX18.
// @author Low & ErikV7 & Anonpony & zooanon
// @match http*://*.zoox18.com/*
// @run-at document-end
// ==/UserScript==
// Functions
function sel(selector){
return document.querySelector(selector)
}
sel.all=sel=>document.querySelectorAll(sel)
function el(props){
const ne=document.createElement(props.tag??'div')
delete props.tag
for(const k in props) ne.setAttribute(k,props[k])
return ne
}
// On load
async function init(){
const ripper=el({id:'rip-div',style:'width: 560px;'}),
tag=el({tag:'li'})
sel('#wrapper>.container').prepend(ripper)
tag.append('ZXDL 2.0.0 - By Low & ErikV7')
sel('.top-menu>.float-left').append(tag)
// Remove annoyances
for(const el of sel.all('.img-private')) el.style.filter='brightness(1)'
for(const el of sel.all('.label-private')) el.style.filter='opacity(0.5)'
if(window.location.pathname.split('/')[1]!='video') return
const id=window.location.pathname.split("/")[2],
paths=['https://www.zoox18.com/media/videos/h264/'+id+'_SD.mp4']
for(const key of ["Afgf8121k", "Iu528sZA", "_asaA34343BN", "082GhjMswdfd3", "HBa23r27ALss", "Iyw9ew27KhgS", "_9121BghguS", "034343sdsA_", "0Gbg3Ga"])
for(const link of ["https://md.zoox18.com/", "https://md1.zoox18.com/", "https://md2.zoox18.com/", "https://media.zoox18.com/", "https://media1.zoox18.com/", "https://media2.zoox18.com/", "https://media.dir.xxx/", "https://media1.dir.xxx/", "https://media2.dir.xxx/"])
paths.push(link+key+'/media/videos/h264/'+id+'_SD.mp4',link+key+'/media/videos/h264/'+id+'_HD.mp4')
ripper.innerHTML='<h1>Script is trying to find an available video source...</h1>'
const urlFound=await Promise.race(paths.map(url=>{
const loader=el({tag:'video'}),
promise=new Promise(resolve=>loader.addEventListener('loadeddata',()=>resolve(url)))
loader.src=url
return promise
}))
ripper.innerHTML='<h1>Video was found! Download it manually.</h1><video style="width: 100%; height: 100%;" poster="https://www.zoox18.com/media/videos/tmb1/'+id+'/default.jpg" id="rippedvid" playsinline controls><source src="'+urlFound+'" type="video/mp4" /></video>'
}
window.addEventListener('load',init,false);