Skip to content

Commit

Permalink
chore(fmt)
Browse files Browse the repository at this point in the history
  • Loading branch information
retrouser955 committed Oct 10, 2024
1 parent ee7ad01 commit 30b818e
Show file tree
Hide file tree
Showing 21 changed files with 1,140 additions and 857 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ tsup.config.ts
CHANGELOG.md
Rotator.md
docs
examples/
examples/
.prettierignore
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
yarn/
docs/
.github/
dist/
bin/
Binary file modified .yarn/install-state.gz
Binary file not shown.
25 changes: 13 additions & 12 deletions examples/trustedToken/potoken.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
const { Worker } = require("node:worker_threads")
const { YoutubeiExtractor } = require("../../dist/index.js") // replace "../../dist/index.js" with "discord-player-youtubei"
const { Worker } = require("node:worker_threads");
const { YoutubeiExtractor } = require("../../dist/index.js"); // replace "../../dist/index.js" with "discord-player-youtubei"

const generateToken = () => new Promise((resolve, reject) => {
const worker = new Worker(`${__dirname}/potoken.worker.js`)
const generateToken = () =>
new Promise((resolve, reject) => {
const worker = new Worker(`${__dirname}/potoken.worker.js`);

worker.once("message", (v) => {
resolve(v)
})
resolve(v);
});

worker.once("error", (v) => {
reject(v)
})
});
reject(v);
});
});

// Register YoutubeiExtractor somewhere around here

// Then, set the tokens to the youtubei extractor
generateToken().then((tokens) => {
const instance = YoutubeiExtractor.getInstance()
const instance = YoutubeiExtractor.getInstance();

if(instance) instance.setTrustedTokens(tokens)
})
if (instance) instance.setTrustedTokens(tokens);
});
8 changes: 4 additions & 4 deletions examples/trustedToken/potoken.worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { generateTrustedToken } = require("../../dist/index.js")
const { parentPort } = require("node:worker_threads")
const { generateTrustedToken } = require("../../dist/index.js");
const { parentPort } = require("node:worker_threads");

generateTrustedToken().then((v) => {
parentPort.postMessage(v)
})
parentPort.postMessage(v);
});
Loading

0 comments on commit 30b818e

Please sign in to comment.