Hi everybody.

I had a case with a client, who copy pasted partial url's of youtube videos, and because we were using fckeditor they would not see the broken video inside it. Although they could click "view source" and remove the code from there, they requested us a better solution.

The only thing i could came up with was to test if the id found using preg_match inside MediaInternetYouTubeHandler's function "parse" was that of a valid video. For this I used the Google Data API, using the API call "Retrieving a specific video entry" - documentation here: http://code.google.com/apis/youtube/2.0/developers_guide_php.html#Unders.... I then test if the headers contain the 200 OK value, or not. If not I do not add the video to the library, and also throw a MediaInternetValidationException about the invalid ID.

I think this is a useful functionality, and could be included in the module, so I am pasting the patch here.

Files: 
CommentFileSizeAuthor
media_youtube_validate.patch1.03 KBmariancalinro

Comments

Status:Needs review» Reviewed & tested by the community

Works for me!

committed that, awesome. Thanks, mariancalinro

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Issue summary:View changes

corrected the message