chaowenguo commited on
Commit
aaa8cdf
1 Parent(s): c618298

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +16 -2
index.js CHANGED
@@ -1,13 +1,27 @@
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()))
 
1
  //npx javascript-obfuscator --unicode-escape-sequence true index.js
2
+ globalThis.document.querySelector('div[style*="flex-direction"] > button').onclick = () =>
3
+ {
4
+ globalThis.document.querySelector('div[style*="flex-direction"]').style.width = globalThis.document.querySelector('div[style*="justify-content"]').style.marginLeft = globalThis.document.querySelector('video').style.marginLeft = 0
5
+ }
6
+ for (const episode of await globalThis.fetch('https://backend.chaowenguo.eu.org/episode').then(_ => _.json()))
7
+ {
8
+ const hyperlink = globalThis.document.createElement('a')
9
+ hyperlink.textContent = hyperlink.href = episode
10
+ globalThis.document.querySelector('div[style*="flex-direction"]').appendChild(hyperlink)
11
+ }
12
+ globalThis.document.querySelector('div[style*="justify-content"] > button').onclick = () =>
13
+ {
14
+ globalThis.document.querySelector('div[style*="flex-direction"]').style.width = globalThis.document.querySelector('div[style*="justify-content"]').style.marginLeft = globalThis.document.querySelector('video').style.marginLeft = '5%'
15
+ }
16
  const drama = globalThis.decodeURIComponent(globalThis.location.pathname).slice(1)
17
+ globalThis.document.querySelector('title').textContent = globalThis.document.querySelector('h1').textContent = drama
18
  for (const episode of globalThis.Array(globalThis.Number(await globalThis.fetch('https://backend.chaowenguo.eu.org/episode', {method:'post', body:drama}).then(_ => _.text()))).keys())
19
  {
20
  const button = globalThis.document.createElement('button')
21
  button.textContent = (episode + 1).toString().padStart(2, 0)
22
  globalThis.document.querySelector('nav').appendChild(button)
23
  }
24
+ for (const button of globalThis.document.querySelectorAll('nav > button')) button.onclick = async event =>
25
  {
26
  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())
27
  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()))