File size: 1,497 Bytes
f7a485e
4865e71
 
 
 
 
 
 
 
f7a485e
 
e755235
 
f7a485e
e755235
f7a485e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//npx javascript-obfuscator --unicode-escape-sequence true index.js
const drama = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
globalThis.document.querySelector('title').textContent = globalThis.document.querySelector('h1').textContent = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
for (const episode of globalThis.Array(globalThis.Number(await globalThis.fetch('https://backend.chaowenguo.eu.org/episode', {method:'post', body:drama}).then(_ => _.text()))).keys())
{
    const button = globalThis.document.createElement('button')
    button.textContent = (episode + 1).toString().padStart(2, 0)
    globalThis.document.querySelector('nav').appendChild(button)
}
for (const button of globalThis.document.querySelectorAll('button')) button.onclick = async event =>
{
    globalThis.document.querySelector('video').querySelector('source').src = await globalThis.fetch('https://backend.chaowenguo.eu.org/mp4', {method:'post', body:globalThis.JSON.stringify({drama, episode:event.target.textContent})}).then(_ => _.text())
    globalThis.document.querySelector('video').querySelector('track').src = globalThis.URL.createObjectURL(await globalThis.fetch('https://backend.chaowenguo.eu.org', {method:'post', body:globalThis.JSON.stringify({drama, episode:event.target.textContent})}).then(_ => _.blob()))
    globalThis.document.querySelector('video').load()
    globalThis.document.querySelector('title').textContent = drama + event.target.textContent
}