Skip to content
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

Error in search #17

Closed
NeddieSeagoon opened this issue Apr 3, 2019 · 4 comments
Closed

Error in search #17

NeddieSeagoon opened this issue Apr 3, 2019 · 4 comments

Comments

@NeddieSeagoon
Copy link

On python 3.7.3 using search returns
File "C:\Program Files\Python37\lib\site-packages\youtube_api\youtube_api.py", line 740, in search if len(videos) >= max_results: TypeError: '>=' not supported between instances of 'int' and 'str'

@NeddieSeagoon
Copy link
Author

Should have said: this occurs if someone doesn't use int() to set max_results

@yinleon
Copy link
Collaborator

yinleon commented Apr 11, 2019

Hi @GryptpypeThynne that parameter should only be an int. If I'm understanding you you hit an error when you used a string for max_results?

@NeddieSeagoon
Copy link
Author

That's right yeah. I only came across the error when using input() to get max_results. I realize that in most cases the input would be sanitized with int(), but I just figured that that could be better done in the actual package, just in to eliminate the error case.

@yinleon
Copy link
Collaborator

yinleon commented Apr 12, 2019

Maybe we can make explicit dtypes for each argument. I think it makes the source code look super weird, but it might be better to change this up. I'll make a new issue for this, thanks @GryptpypeThynne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants