chaowenguo commited on
Commit
4865e71
1 Parent(s): 949d068

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +8 -1
index.js CHANGED
@@ -1,7 +1,14 @@
1
  //npx javascript-obfuscator --unicode-escape-sequence true index.js
 
 
 
 
 
 
 
 
2
  for (const button of globalThis.document.querySelectorAll('button')) button.onclick = async event =>
3
  {
4
- const drama = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
5
  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())
6
  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()))
7
  globalThis.document.querySelector('video').load()
 
1
  //npx javascript-obfuscator --unicode-escape-sequence true index.js
2
+ const drama = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
3
+ globalThis.document.querySelector('title').textContent = globalThis.document.querySelector('h1').textContent = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
4
+ for (const episode of globalThis.Array(globalThis.Number(await globalThis.fetch('https://backend.chaowenguo.eu.org/episode', {method:'post', body:drama}).then(_ => _.text()))).keys())
5
+ {
6
+ const button = globalThis.document.createElement('button')
7
+ button.textContent = (episode + 1).toString().padStart(2, 0)
8
+ globalThis.document.querySelector('nav').appendChild(button)
9
+ }
10
  for (const button of globalThis.document.querySelectorAll('button')) button.onclick = async event =>
11
  {
 
12
  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())
13
  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()))
14
  globalThis.document.querySelector('video').load()