Closed hicay closed 3 months ago
Specify poToken
and visitorData
as the second argument of the ytdl function.
Thannk you @ybd-project . I tried different type of solutions and fixed it. Best one is;
const info = await ytdl.getInfo(
`https://www.youtube.com/watch?v=${videoId}`,
{
agent,
poToken: PO_TOKEN,
visitorData: VISITOR_DATA,
},
);
// Get info first and download from info
const videoReadableStream = ytdl.downloadFromInfo(info, {
filter: 'audioandvideo',
quality: 'lowest',
poToken: PO_TOKEN,
visitorData: VISITOR_DATA,
});
Describe the bug
Works locally fine! But not in AWS Lambda for download https://github.com/ybd-project/ytdl-core/blob/2062b0934c5aea2296fc43b619e86cc29a6ad329/src/info.ts#L522
Error Details (Log)
Environment