Open snoitallicso opened 3 years ago
🤔 looks like the example for ytpl.continueReq
is invalid
that function should return a promise and therefor also require a promise
e.g.:
const ytpl = require('ytpl');
const firstResultBatch = await ytpl('UU_aEa8K-EOJ3D6gOs7HcyNg', { pages: 1 });
const secondResultBatch = await ytpl.continueReq(firstResultBatch.continuation);
const thirdResultBatch = await ytpl.continueReq(secondResultBatch.continuation);
// You can now use the .items property of all result batches e.g.:
console.log(firstResultBatch.items);
console.log(secondResultBatch.items);
console.log(thirdResultBatch.items);
Nodejs version: v14.17.6
I'm using standard code from the docs:
SyntaxError: await is only valid in async function
ok then I rewtire 3 line without await (sure dumb solution but it work)
and got a new errors