joetats/youtube_search

Intermitent Issue: raised an exception: KeyError: 'sectionListRenderer'

Opened this issue · 2 comments

Hi,

I get this error from time to time but somehow on 2nd call it resolves itself.Maybe something to be looked into.

Regards,
Subhadip
error_youtube_search

I can confirm this.

This is the full stack trace:

Traceback (most recent call last):
  File "/Users/yamilmolinar/Repos/music-buddy/./main.py", line 18, in <module>
    results = YoutubeSearch(artist + ' - ' + song, max_results=10).to_dict()
  File "/usr/local/lib/python3.9/site-packages/youtube_search/__init__.py", line 10, in __init__
    self.videos = self.search()
  File "/usr/local/lib/python3.9/site-packages/youtube_search/__init__.py", line 19, in search
    results = self.parse_html(response)
  File "/usr/local/lib/python3.9/site-packages/youtube_search/__init__.py", line 35, in parse_html
    videos = data["contents"]["twoColumnSearchResultsRenderer"]["primaryContents"][
KeyError: 'sectionListRenderer'

Any progress?