Fixed Metacafe BB Code Media Site does not match all Metacafe videos

Chris D

XenForo developer
Staff member
Example:
http://www.metacafe.com/watch/11151921
http://www.metacafe.com/watch/11151921

Fix here is adding a trailing slash:
http://www.metacafe.com/watch/11151921/
Embedded media from this media site is no longer available

Example 2:
http://www.metacafe.com/watch/an-pX6S2u2n2hbbJt/cat_in_the_hat_2003_the_house_transformed_from_opening_the_crate/
http://www.metacafe.com/watch/an-pX...the_house_transformed_from_opening_the_crate/

Fix required here is a change in the regex. The XenForo expression assumes the ID will be digits only, whereas it seems this is not the case.
 
The second link wouldn't work (embed) anyways because the embed option is actually disabled at the site, if you click on embed below the video you will see it is muted out...you can clip and embed with the js functions they have in that player container but they appear to clip and link to a different site...on that note however I just tried this out and it seems to work for parsing those vid links...

Code:
#metacafe\.com/watch/(?P<id>[a-z0-9-]+)(/[a-z0-9_-]+)?#siu
 
So it looks like integers are for their own videos and strings are links to other video sites. For example, it actually links to YouTube if the ID starts with "yt-". YT videos are embeddable, though as it stands others don't seem to be.

The regex I'm using is:
Code:
#metacafe\.com/watch/(?P<id>[a-z0-9-]+)(/|$)#siU

The embed code needs to be changed support the "re-embed" videos as well:
Code:
<iframe src="http://www.metacafe.com/embed/{$id}/" width="500" height="300" allowFullScreen frameborder=0></iframe>

I'm making these changes for 1.3.
 
Top Bottom