alaouy / YouTube

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

How to get the list of channel videos without youtube shorts #191

Open yasir-naseer opened 7 months ago

yasir-naseer commented 7 months ago

Im using Youtube::listChannelVideos() to get the list of channel videos, but it also returns the youtube short, is there a way to filter so we can only get videos?

alaouy commented 6 months ago

@yasir-naseer Did you manage to find a solution ?

yasir-naseer commented 6 months ago

not yet

noxyz20 commented 2 months ago

Hi, The only way I've found is to filter directly via the description key, if it's empty then it'll be a short. Unfortunately, this isn't 100% reliable.

$videoList = Youtube::listChannelVideos('xxxxxxxxxxxxxx', 40, 'date');

$videosWithoutShort = collect($videoList)->filter(function ($item) {
    return !empty($item->snippet->description);
})