Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pablouser1 committed Nov 5, 2022
1 parent dd94ff0 commit 89bcb58
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 120 deletions.
11 changes: 2 additions & 9 deletions api/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const Signer = require("../src/Signer");
const http = require("http");
const Utils = require("../src/Utils");

const PORT = process.env.PORT || 8080;

Expand All @@ -20,15 +21,7 @@ const server = http.createServer(async (req, res) => {

const data = signer.sign(url);
console.log("Sent data from request with url: " + url);
res.write(
JSON.stringify({
status: "ok",
data: {
...data,
navigator: signer.navigator()
}
})
);
res.write(Utils.makePayload(data, signer.navigator()));
} else {
res.write(
JSON.stringify({
Expand Down
3 changes: 2 additions & 1 deletion local.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const Signer = require("./src/Signer")
const Utils = require("./src/Utils")

if (process.argv.length > 2) {
const signer = new Signer()
const url = process.argv[2]

const data = signer.sign(url)
console.log(data)
console.log(Utils.makePayload(data, signer.navigator()))
}
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{
"name": "signtok",
"version": "1.2.0",
"version": "1.2.1",
"description": "Sign your TikTok requests easily",
"repository": "https://github.com/pablouser1/SignTok",
"author": "Pablo Ferreiro",
"main": "src/Signer.js",
"license": "MIT",
"keywords": ["tiktok", "tiktok-signer", "jsdom"],
"keywords": [
"tiktok",
"tiktok-signer",
"jsdom"
],
"scripts": {
"start": "node api/index.js",
"vercel-build": "yum -y install libuuid-devel libmount-devel && cp /lib64/{libuuid,libmount,libblkid}.so.1 node_modules/canvas/build/Release/"
},
"dependencies": {
"canvas": "^2.9.3",
"jsdom": "^19.0.0"
"jsdom": "^20.0.2",
"canvas": "^2.10.2"
}
}
10 changes: 10 additions & 0 deletions src/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ class Utils {
// TODO, add proper verify fp method
return "verify_68b8ccfa65726db8b3db0cc07821d696";
}

static makePayload(data, navigator) {
return JSON.stringify({
status: "ok",
data: {
...data,
navigator
}
})
}
}

module.exports = Utils;
Loading

0 comments on commit 89bcb58

Please sign in to comment.