-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Cannot read properties of undefined (reading 'videoId')" in nodejs lambda environment. #124
Comments
Me too, my own crawler tool is also facing this problem, I'm working on it |
Could you please provide the minimum code that reproduces this problem? |
Sure thing, here's my deployment code:
|
Is there a debugging method to log the http calls from the youtubei/src/youtube/Client/Client.ts Lines 121 to 134 in 1460ae8
|
seems like YouTube made some changes to the response data, this changes rolled up on some user / IP (my local PC loads the data just fine, but I'm facing similar error on my server), checking it Edit: I think it's caused by your IP got flagged by YouTube, so the client isn't able to retrieve the data properly, I'll try to look for a solution |
Hi, I've working on this issue for a while and find the solution for getting video information #126 |
I got same error and using proxy: /www/wwwroot/youtubei/node_modules/youtubei/dist/cjs/youtube/BaseVideo/BaseVideoParser.js:14 TypeError: Cannot read properties of undefined (reading 'videoId') |
as far i know, youtube always flag suspicious IP, make sure you have to slow down or make random interval request, so your server IP doesn't get flag 'spam' by Youtube |
I found what file was erroring, I edited the build (sorry) and made it log the "raw" thing it got before it tried to get values from it and saw that the response was beautiful and in my case I would actually be fine with just having that data and parsing it myself (but obviously its not that easy) So I don't think its an error due to YouTube returning a bad response, they probably changed how the response looks and yeah. Unless I'm not recognizing it's not returning the actual info. EDIT: Ended up monkey patching the build, it seems to work? |
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?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
It not throw, as it doesn't locally.
The text was updated successfully, but these errors were encountered: