mirror of
https://codeberg.org/ashley/poke.git
synced 2024-12-01 07:57:24 +01:00
encryption json
This commit is contained in:
parent
19757f793c
commit
ff1aa34517
1 changed files with 39 additions and 0 deletions
39
server.js
39
server.js
|
@ -78,6 +78,45 @@ const config = {
|
|||
|
||||
// pages
|
||||
|
||||
app.get("/encryption", async function (req, res) {
|
||||
|
||||
var v = req.query.v;
|
||||
|
||||
const video = await fetch(config.tubeApi + `video?v=${v}`);
|
||||
var fetching = await fetcher(v);
|
||||
|
||||
const json = fetching.video.Player;
|
||||
const h = await video.text();
|
||||
const k = JSON.parse(toJson(h));
|
||||
if (!v) res.redirect("/");
|
||||
|
||||
//video
|
||||
const j = fetching.video.Player.Formats.Format,
|
||||
j_ = Array.isArray(j) ? j[j.length - 1] : j;
|
||||
let url;
|
||||
if (j_.URL != undefined) url = j_.URL;
|
||||
|
||||
// json response
|
||||
const re = {
|
||||
main:{
|
||||
video_id:sha384(json.id),
|
||||
channel:sha384(json.Channel.Name),
|
||||
title:sha384(json.Title),
|
||||
date:sha384(btoa(Date.now()).toString())
|
||||
},
|
||||
info:{
|
||||
desc:sha384(json.Description)
|
||||
},
|
||||
video:{
|
||||
title:sha384(json.Title),
|
||||
url:sha384(url)
|
||||
}
|
||||
}
|
||||
|
||||
res.json(re)
|
||||
|
||||
});
|
||||
|
||||
app.get("/watch", async function (req, res) {
|
||||
/*
|
||||
* QUERYS
|
||||
|
|
Loading…
Reference in a new issue