DrKain / scrape-youtube

A lightning fast package to scrape YouTube search results
MIT License
112 stars 30 forks source link

Invalid JSON returned on empty searches where itemSectionRenderer does not exist #39

Closed MattieTK closed 3 years ago

MattieTK commented 3 years ago

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:

Additional context I guess youtube changed their styling 😢

DrKain commented 3 years ago

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

DrKain commented 3 years ago

Should be fixed in 2.1.4

MattieTK commented 3 years ago

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

Thanks @DrKain 🥳