DrKain/scrape-youtube

Invalid JSON returned on empty searches where itemSectionRenderer does not exist

MattieTK opened this issue · 3 comments

Describe the bug
Hi there,

This seems to happen when no results are returned:
eg. https://www.youtube.com/results?search_query=Benzinga+Live&sp=EgJAAQ%253D%253D

To Reproduce
Steps to reproduce the behavior:

  1. Make a search for which no results are returned
  2. See the error TypeError: Cannot read property 'itemSectionRenderer' of undefined

Expected behavior
The search should return empty

Screenshots
The Bezinga search is the one that isn't returning at this time, and this is where the error is thrown.
image

Versions:

  • Package: 2.1.3
  • Node: 14.16

Additional context
I guess youtube changed their styling 😢

Thanks for reporting. I'll take a look at this shortly

Should be fixed in 2.1.4

Went to look for this in the morning and not in my issues list... oh wait it's already closed!

Thanks @DrKain 🥳