SuspiciousLookingOwl / youtubei

Get Youtube data such as videos, playlists, channels, video information & comments, related videos, up next video, and more!
https://suspiciouslookingowl.github.io/youtubei
MIT License
239 stars 50 forks source link

"Cannot read properties of undefined (reading 'videoId')" in nodejs lambda environment. #124

Open jo-sip opened 4 hours ago

jo-sip commented 4 hours ago

Describe the bug I'm running into an issue where supplying a valid videoId throws a stack trace when running in a lambda environment. This happens:

TypeError: Cannot read properties of undefined (reading 'videoId') at BaseVideoParser.loadBaseVideo (/var/task/index.js:79129:44) at Video.load (/var/task/index.js:79289:43) at Video.load (/var/task/index.js:80595:15) at Client3. (/var/task/index.js:80753:113) at Generator.next () at fulfilled (/var/task/index.js:80655:28) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

when the videoId is defined.

Could there be some async client issue? Static loadBaseVideo member? parseRawData returning null or no data? I'm thinking the latter could be likely, are there some options I need to set for different environments?

const youtube = new Client();

To Reproduce Steps to reproduce the behavior:

Expected behavior It not throw, as it doesn't locally.

xiaohaoxing commented 2 hours ago

Me too, my own crawler tool is also facing this problem, I'm working on it