mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-26 02:19:01 +01:00
use in ... data :p
This commit is contained in:
parent
aed5b1726b
commit
ce9ed2c4a3
1 changed files with 9 additions and 1 deletions
|
@ -108,6 +108,14 @@ function IsInArray(array, id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getJson(str) {
|
||||||
|
try {
|
||||||
|
return JSON.parse(str);
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = function (app, config, renderTemplate) {
|
module.exports = function (app, config, renderTemplate) {
|
||||||
app.get("/encryption", async function (req, res) {
|
app.get("/encryption", async function (req, res) {
|
||||||
var v = req.query.v;
|
var v = req.query.v;
|
||||||
|
@ -194,7 +202,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
if (isvld) {
|
if (isvld) {
|
||||||
core.video(v).then((data) => {
|
core.video(v).then((data) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
if ("video" in data) {
|
if ("video" in getJson(data)) {
|
||||||
const k = data.video;
|
const k = data.video;
|
||||||
const json = data.json;
|
const json = data.json;
|
||||||
const engagement = data.engagement;
|
const engagement = data.engagement;
|
||||||
|
|
Loading…
Reference in a new issue