Skip to content

Commit

Permalink
Fix path.
Browse files Browse the repository at this point in the history
  • Loading branch information
YunzheZJU committed Aug 6, 2024
1 parent 7cd0705 commit 521da81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/task.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const fs = require('fs/promises')
const path = require('path')
const { JSDOM, VirtualConsole } = require('jsdom')
const { url, userAgent } = require('./consts')

const createTask = async (visitorData) => {
const domContent = await fs.readFile('vendor/index.html', 'utf-8')
const baseContent = await fs.readFile(`vendor/base.js`, 'utf-8')
const baseAppendContent = await fs.readFile(`lib/inject.js`, 'utf-8')
const domContent = await fs.readFile(path.join(__dirname, '..', 'vendor', 'index.html'), 'utf-8')
const baseContent = await fs.readFile(path.join(__dirname, '..', 'vendor', 'base.js'), 'utf-8')
const baseAppendContent = await fs.readFile(path.join(__dirname, 'inject.js'), 'utf-8')
let destroy = undefined
return {
stop: () => destroy?.(),
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "youtube-po-token-generator",
"version": "0.1.0",
"version": "0.2.0",
"author": "Yunzhe <[email protected]>",
"description": "It generates a valid poToken with visitorData fetched from YouTube.",
"keywords": [
Expand All @@ -20,5 +20,10 @@
},
"engines": {
"node": ">=18.0"
}
},
"files": [
"vendor/",
"lib/",
"index.js"
]
}

0 comments on commit 521da81

Please sign in to comment.