Closed Topiya closed 2 weeks ago
Thank you for your report. I will install Ubuntu on the virtual machine and try it.
Thank you. I'd appreciate it if you could reply soon, as I need the solution urgently.
It works fine in my environment. Please let me know what code you are implementing as best you can.
Ubantu verion: 16.04
const YtdlCore = require("@ybd-project/ytdl-core");
app.get('/ybdtest', async function (req, res) {
const fs = require('fs');
const ytdl = new YtdlCore({});
// Download a video
ytdl.download('https://www.youtube.com/watch?v=aqz-KE-bpKQ').pipe(fs.createWriteStream('video.mp4'));
});
Also I would like to mention that I am getting above error on run the script 'node download.js', without even accessing route.
const YtdlCore = require("@ybd-project/ytdl-core");
but change it to the following
const { YtdlCore } = require("@ybd-project/ytdl-core");
I have tried with both of it but getting same error.
So I have tried lower version of @ybd-project/ytdl-core 5.0.7 with node 14.21.3 using const YtdlCore = require("@ybd-project/ytdl-core"); which is also giving same error.
Maybe the problem is the "??=" syntax (if the value is empty, assign it). So we will release a version (v5.1.3) by the end of tomorrow that does not use this syntax.
v5.1.3 has been released. Please check to see if the problem has been fixed.
Using latest plugin v5.1.3, I have checked with node 20.17 in Ubantu (16.04) . Still getting same error.
/@ybd-project/ytdl-core/package/YtdlCore.js:68
options ??= {};
^^^
SyntaxError: Unexpected token '??='
I am using the same Ubuntu version with node 14 and ybd-project/ytdl-core 5.1.3 and i am experiencing the same error. Is there a compatible version for node 14?
Since the “??=” was still there, we removed it all and released v5.1.4.
I am using the same Ubuntu version with node 14 and ybd-project/ytdl-core 5.1.3 and i am experiencing the same error. Is there a compatible version for node 14?
The "??=" syntax in question was supported starting with Node.js 16, so I believe the error occurs in 14. I think it is ok since we removed "??=" completely in v5.1.4.
I am getting below error on accessing my node route.
at async Function.generatePoToken (/home/ubuntu/api/node_modules/@ybd-project/ytdl-core/package/core/PoToken.js:8:26)
(node:7840) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection,
Below is my node GET route code:
const { YtdlCore } = require("@ybd-project/ytdl-core");
app.get('/ybdtest', async function (req, res) { // I have tried here by removing async also
const fs = require('fs');
const ytdl = new YtdlCore({});
ytdl.download('https://www.youtube.com/watch?v=aqz-KE-bpKQ').pipe(fs.createWriteStream('video.mp4'));
});
It seems to be due to the fact that error handling is not set up when poToken generation fails. A version (v5.1.4-2) fixing this will be released soon.
I am using the same Ubuntu version with node 14 and ybd-project/ytdl-core 5.1.3 and i am experiencing the same error. Is there a compatible version for node 14?
The "??=" syntax in question was supported starting with Node.js 16, so I believe the error occurs in 14. I think it is ok since we removed "??=" completely in v5.1.4.
I am experiencing the same PoToken error. We are eagerly awaiting your new fixes.
Released. We are currently building an environment with Ubuntu 16.04 and Node.js 14 and 20.
Getting the following error after updating the new release.
(node:1824) UnhandledPromiseRejectionWarning: Error: TypeError: Object.hasOwn is not a function
at Function.g.C_.create (eval at --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1824) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:1824) UnhandledPromiseRejectionWarning: Error: TypeError: Object.hasOwn is not a function
at Function.g.C_.create (eval at --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
[ ERROR ]: Failed to generate a poToken.
Details: TypeError: destroy is not a function
Reason: Sign in to confirm you're not a bot
Reason: Sign in to confirm you're not a bot
Reason: Sign in to confirm you're not a bot
Reason: Sign in to confirm you're not a bot
Reason: Sign in to confirm you're not a bot
(node:1824) UnhandledPromiseRejectionWarning: Error: All player APIs responded with an error. (Clients: web, webCreator, tvEmbedded, ios, android)
For more information, specify YTDL_DEBUG as an environment variable.
Note: This error cannot continue processing. (Details: "Sign in to confirm you're not a bot")
at Function.getApiResponses (/node_modules/@ybd-project/ytdl-core/package/core/Info/apis/Player.js:48:23)
at runMicrotasks (--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)
[ ERROR ]: Failed to generate a poToken.
Details: TypeError: destroy is not a function
The best option is to update Node.js, but if you can't, specify PoToken and VisitorData in the options.
Is the problem resolved?
Not yet, so we are planning to update ubuntu as well as node js.
I am using v5.1.2 version of @ybd-project/ytdl-core which is working fine in Windows but getting below error Ubantu. Node version is same in both systems as mentioned below.
Can anyone please help me solve this problem?