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.
Comment | File | Size | Author |
---|---|---|---|
media_youtube_validate.patch | 1.03 KB | mariancalinro | |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedWorks for me!
Comment #2
aaron CreditAttribution: aaron commentedcommitted that, awesome. Thanks, mariancalinro
Comment #3
aaron CreditAttribution: aaron commentedComment #4.0
(not verified) CreditAttribution: commentedcorrected the message