alaouy / YouTube

🔥 Laravel PHP Facade/Wrapper for the Youtube Data API
MIT License
778 stars 204 forks source link

Checking if adding comments is allowed #176

Closed GajdosGabriel closed 2 years ago

GajdosGabriel commented 2 years ago

I use the getCommentThreadsByVideoId () function

The problem is that some videos have comments turned off, and then the cycle stops with an error

Exception Error 403 The video identified by the videoId parameter has disabled comments. : commentsDisabled How can I avoid this by checking if adding comments is allowed?

Thank you for a great extension.

alaouy commented 2 years ago

@GajdosGabriel You will need to use a try catch block https://www.php.net/manual/en/language.exceptions.php in order to handle that case.