This is broken for users of media 1.x, where file_uri_to_object() doesn't reuse existing file objects by default. I'm not sure if media_youtube is still willing to support media 1.x, but if so, here's a patch. Note that this patch also sets the file object's timestamp to the request time, so that when someone reuploads a video, it shows up as the newest media item at the top of the admin list.

I know this is fixed but actually I think there's no need to override the save() method in MediaInternetYouTubeHandler :

This method is overridden to put a timestamp to the file, this is done in the file_save() function called just after that.

The original save() method (from MediaInternetHandler) call a preSave() method that have to be overriden in children to do additional operations, before the file has been saved

MediaInternetYouTubeHandler :

<?phppublic function save() {$file = $this->getFileObject();// If a user enters a duplicate YouTube URL, the object will be saved again. // Set the timestamp to the current time, so that the media item shows up // at the top of the media library, where they would expect to see it.$file->timestamp = REQUEST_TIME;file_save($file); return $file; }?>

Good points. However, file_save only adds a timestamp if not already present; we're actually potentially altering an already existing timestamp. But overriding ->presave would certainly simplify the code.