How to get the list of channel videos without youtube shorts
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?
@yasir-naseer Did you manage to find a solution ?
not yet
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);
})
@yasir-naseer The only reliable way for now to check if a video is a short is to call the url https://www.youtube.com/shorts/ + videoId and check if the status code is 200 ok.
Ref: https://stackoverflow.com/a/72197652