joetats / youtube_search

Tool for searching for youtube videos to avoid using their heavily rate-limited API
MIT License
220 stars 64 forks source link

Empty Results #26

Closed x011 closed 3 years ago

x011 commented 3 years ago
from youtube_search import YoutubeSearch
results = YoutubeSearch('youtube', max_results=10).to_json()
print(results)

Returns an empty object:

{"videos": []}

I have a working internet connection and no errors are presented. Any idea why?

isagastiberri commented 3 years ago

I'm getting this error if I search Navidad (Christmas in Spanish), but not if I search Christmas and neither with youtube. So I'm not sure what's going on

losspamerianos commented 3 years ago

For me changing encoded_search = urllib.parse.quote(self.search_terms) to encoded_search = urllib.parse.quote_plus(self.search_terms) did the job.

joetats commented 3 years ago

Probably should be quote_plus anyway, I've made the change and it's still working so I'll roll that into the package soon. Thanks for looking into it!