In PHP:
Assuming you already have a service object.
$listResponse = $service->videos->listVideos('status', ['id' => $youtube_id]);
$video = $listResponse[0];
$status = $video->getStatus();
$uploadStatus = $status['uploadStatus'];
$failureReason = $status['failureReason'];
$rejectionReason = $status['rejectionReason'];
if ( $uploadStatus == 'rejected' && $rejectionReason == 'duplicate' ) {
throw new Exception('Duplicate');
fi
uploadStatus can be one of the following: deleted, failed, processed, rejected, uploaded
failureReason can be one of the following: codec, conversion, emptyFile, invalidFile, tooSmall, uploadAborted
rejectionReason can be one of the following: claim, copyright, duplicate, inappropriate, legal, length, termsOfUse, trademark, uploaderAccountClosed, uploaderAccountSuspended
I haven’t found a way to retrieve the ID of the original video of which the offending video is a duplicate.
See the documentation for the video object at https://developers.google.com/youtube/v3/docs/videos