regex for embed video

Written by all for wordpress on 11:33 AM

The regural expression for auto embed video link for your script.

youtube
find :#(?:<\>]+href=\")?(?:http://)?((?:[a-zA-Z]{1,4}\.)?youtube.com/(?:watch)?\?v=(.{11}?))[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$matches[2].'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.$matches[2].'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'

find :#\[youtube\]([^\[\]]+)\[/youtube\]#
replace : '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/'.$matches[1].'"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'.$matches[1].'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'


google video
find :#(?:<\>]+href=\")?(?:http://)?(video.google.(?:[A-Za-z\.]{2,5})/videoplay\?docid=([0-9\-]+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed style="width:400px; height:326px;" wmode="opaque" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='.$matches[2].'&hl=en" flashvars=""> </embed>'

find :#\[googlevideo\]([^\[\]]+)\[/googlevideo\]#
replace : '<embed style="width:400px; height:326px;" id="VideoPlayback" wmode="opaque" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='.$matches[1].'&hl=en" flashvars=""> </embed>'

myspace
find :#(?:<\>]+href=\")?(?:http://)?(vids.myspace.com/index.cfm\?fuseaction=vids\.individual&VideoID=(\d{8,15})(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://lads.myspace.com/videos/vplayer.swf" wmode="opaque" flashvars="m='.$matches[2].'&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346"></embed>'

find :#\[myspace\]([^\[\]]+)\[/myspace\]#
replace : '<embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m='.$matches[1].'&v=2&type=video" wmode="opaque" type="application/x-shockwave-flash" width="430" height="346"></embed>'

metacafe
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?metacafe.com/watch/([0-9]*\/[A-Za-z0-9_]*)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://www.metacafe.com/fplayer/'.$matches[2].'.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>'

find :#\[metacafe\]([^\[\]]+)\[/metacafe\]#
replace : '<embed src="http://www.metacafe.com/fplayer/'.$matches[1].'.swf" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed>'

yahoo video
find :#(?:<\>]+href=\")?(?:http://)?(video.yahoo.com/video/play\?vid=(\d+)&matchid=(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf" wmode="opaque" flashvars="vid='.$matches[2].'&id='.$matches[3].'" type="application/x-shockwave-flash" width="425" height="350"></embed>'

koreus
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?koreus.com/video/([^\.]+).html(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object type="application/x-shockwave-flash" data="http://www.koreus.com/video/'.$matches[2].'" wmode="opaque" height="320" width="400"><param name="movie" value="http://www.koreus.com/video/'.$matches[2].'"></object>'

sapo.pt
find :#(?:<\>]+href=\")?(?:http://)?(videos.sapo.pt/(.{20})(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://imgs.sapo.pt/sapovideo/swf/flvplayer-sapo.swf?file=http://rd3.videos.sapo.pt/'.$matches[2].'/mov/1" type="application/x-shockwave-flash" width="400" height="325" wmode="transparent"></embed>'

liveleak
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?liveleak.com/view\?i=(.{14})(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://www.liveleak.com/player.swf" wmode="opaque" width="450" height="370" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="autostart=false&token='.$matches[2].'" scale="showall" name="index"></embed>'

gametrailers
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?gametrailers.com/player/(\d+).html(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="480" height="409"><param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?mid='.$matches[2].'"/> <param name="quality" value="high" /><embed src="http://www.gametrailers.com/remote_wrap.php?mid='.$matches[2].'" wmode="opaque" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="409"></embed> </object>'

find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?gametrailers.com/player/usermovies/(\d+).html(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="gtembed" width="480" height="409"><param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.gametrailers.com/remote_wrap.php?umid='.$matches[2].'"/> <param name="quality" value="high" /><embed src="http://www.gametrailers.com/remote_wrap.php?umid='.$matches[2].'" wmode="opaque" swLiveConnect="true" name="gtembed" align="middle" allowScriptAccess="sameDomain" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="480" height="409"></embed> </object>'

streetfire
find :#(?:<\>]+href=\")?(?:http://)?(videos.streetfire.net/video/([A-Za-z0-9\-]+)\.htm(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://videos.streetfire.net/vidiac.swf" FlashVars="video='.$matches[2].'" wmode="opaque" quality="high" bgcolor="#ffffff" width="428" height="352" name="ePlayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'
veoh
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?veoh.com/videos/([A-Za-z0-9]+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://www.veoh.com/videodetails2.swf?permalinkId='.$matches[2].'&id=anonymous&player=videodetailsembedded&videoAutoPlay=0" allowFullScreen="true" wmode="opaque" width="540" height="438" bgcolor="#000000" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'
myvideo.de
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?myvideo.de/watch/(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object style="width:470px;height:406px;" type="application/x-shockwave-flash" data="http://www.myvideo.de/movie/'.$matches[2].'" wmode="opaque"> <param name="movie" value="http://www.myvideo.de/movie/'.$matches[2].'"/> <param name="FlashVars" value="DESTSERVER=http://www.myvideo.de&LINKTEXT=MyVideo"/> <param name="AllowFullscreen" value="true" /></object>'

gamespot
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?gamespot.com/video/(\d+)/(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace :$PASSIVEURL = $matches[1]; $PASSIVETITLE = $matches[4]; '<embed id="mymovie" wmode="opaque" width="432" height="355" flashvars="paramsURI=http%3A%2F%2Fwww%2Egamespot%2Ecom%2Fpages%2Fvideo%5Fplayer%2Fproteus%5Fxml%2Ephp%3Fadseg%3D761515%26adgrp%3D11542%26sid%3D'.$matches[3].'%26pid%3D'.$matches[2].'%26mb%3D%26onid%3D%26nc%3D1193358559372%26embedded%3D1%26showWatermark%3D0%26autoPlay%3D0" allowfullscreen="true" allowscriptaccess="always" quality="high" name="mymovie" src="http://image.com.com/gamespot/images/cne_flash/production/media_player/proteus/gs/proteus_embed.swf" type="application/x-shockwave-flash"/>'

stage6
find :#(?:<\>]+href=\")?(?:http://)?((?:stage6\.divx(?:www\.)?stage6).com/[^"]+video/(\d+)/(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?# replace : '<object codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab" height="480" width="640" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616"><param name="autoplay" value="false"><param name="src" value="http://video.stage6.com/'.$matches[2].'/.divx" /><param name="custommode" value="Stage6" /><param name="showpostplaybackad" value="false" /><embed type="video/divx" src="http://video.stage6.com/'.$matches[2].'/.divx" pluginspage="http://go.divx.com/plugin/download/" wmode="opaque" showpostplaybackad="false" custommode="Stage6" autoplay="false" height="480" width="640" /></object>'

sevenload
find :#(?:<\>]+href=\")?(?:http://)?(\w{2}.sevenload.com/videos/([A-Za-z0-9]+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object width="425" height="350"><param name="FlashVars" value="apiHost=api.sevenload.com"/><param name="movie" value="http://en.sevenload.com/pl/'.$matches[2].'/425x350/swf" /><embed src="http://en.sevenload.com/pl/'.$matches[2].'/425x350/swf" wmode="opaque" type="application/x-shockwave-flash" width="425" height="350" allowfullscreen="true" FlashVars="apiHost=api.sevenload.com"></embed></object>'

izlesene
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?izlesene.com/video/[^\/]+/(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object width="432" height="344"><param name="movie" value="http://www.izlesene.com/player2.swf?video='.$matches[2].'"></param><param name="wmode" value="transparent"></param><embed src="http://www.izlesene.com/player2.swf?video='.$matches[2].'" wmode="transparent" width="432" height="344" type="application/x-shockwave-flash"></embed></object>'

vidiac
find :#(?:<\>]+href=\")?(?:http://)?(([A-Za-z0-9\-]+)\.vidiac.com/video/([A-Za-z0-9\-]+)\.htm(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?# replace : '<embed src="http://'.$matches[2].'.vidiac.com/vidiac.swf" FlashVars="video='.$matches[3].'" quality="high" bgcolor="#ffffff" width="428" height="352" name="ePlayer" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>'
xtube
find :#(?:<\>]+href=\")?(?:http://)?((?:[^\.]+\.)?xtube.com/watch_video.php\?cv=\d+&idx=(\d+)&v=([A-Za-z0-9\-\_]+)&cl=([A-Za-z0-9\-\_]+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="499" height="428" id="player" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="http://pc'.$matches[2].'.xtube.com/embed_player.swf?idx=pc'.$matches[2].'&auto=0&video_id='.$matches[3].'&clip_id='.$matches[4].'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="http://pc'.$matches[2].'.xtube.com/embed_player.swf?idx='.$matches[2].'&auto=0&video_id='.$matches[3].'&clip_id='.$matches[4].'" quality="high" wmode="opaque" bgcolor="#ffffff" width="499" height="428" name="player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>'
vidmax
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?vidmax.com/index.php/videos/view/(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://vidmax.com/img/vidmax_player.swf" wmode="opaque" width="450" height="447" bgcolor="#FFFFFF" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="xml=http://vidmax.com/index.php/videos/playlist/&id='.$matches[2].'&autoPlay=false&bg=http://vidmax.com/img/back.jpg" scale="showall" name="index" />'

redtube
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?redtube.com/(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object height="344" width="434"><param name="movie" value="http://embed.redtube.com/player/"><param name="FlashVars" value="id='.$matches[2].'&style=redtube"><embed src="http://embed.redtube.com/player/?id='.$matches[2].'&style=redtube" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="opaque" height="344" width="434"></object>'

onsmash
find :#(?:<\>]+href=\")?(?:http://)?(videos.onsmash.com/v/([A-Za-z0-9]+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object width="448" height="374"><param name="movie" value="http://videos.onsmash.com/e/'.$matches[2].'"></param><embed src="http://videos.onsmash.com/e/'.$matches[2].'" type="application/x-shockwave-flash" wmode="opaque" width="448" height="374"></embed></object>'

godtube
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?godtube.com/view_video.php\?viewkey=([A-Za-z0-9]+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://godtube.com/flvplayer.swf" FlashVars="viewkey='.$matches[2].'" wmode="transparent" quality="high" width="330" height="270" name="godtube" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>'
pornotube
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?pornotube.com/media.php\?m=(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://pornotube.com/player/v.swf?v=' . base64_encode("m=" . $matches[2] . "&local=false") . '" loop="false" quality="high" wmode="opaque" width="480" height="400" name="pornoPlayer" allowfullscreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'

photobucket
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?photobucket.com/mediadetail/\?media=(?:http%3A%2F%2Fphotobucket.com)?%2Fplayer.swf%3Ffile%3D(.*\.flv)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed width="448" height="361" type="application/x-shockwave-flash" wmode="transparent" src="http://vid138.photobucket.com/player.swf?file='.urldecode($matches[2]).'"></embed>'

find :#(?:<\>]+href=\")?(?:http://)?(s(\d+).photobucket.com/albums/([A-Za-z0-9\-\_\/]+)\?action=view&current=([A-Za-z0-9\-\_]+)(?:.*\.flv)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed width="448" height="361" type="application/x-shockwave-flash" wmode="transparent" src="http://i'.$matches[2].'.photobucket.com/player.swf?file=http://vid'.$matches[2].'.photobucket.com/albums/'.$matches[3].$matches[4].'.flv"></embed>'

brightcove
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?brightcove.tv/title.jsp\?title=(\d+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://www.brightcove.tv/playerswf" bgcolor="#FFFFFF" flashVars="initVideoId='.$matches[2].'&servicesURL=http://www.brightcove.tv&viewerSecureGatewayURL=https://www.brightcove.tv&cdnURL=http://admin.brightcove.com&autoStart=false" base="http://admin.brightcove.com" name="bcPlayer" wmode="opaque" width="486" height="412" allowFullScreen="true" allowScriptAccess="always" seamlesstabbing="false" type="application/x-shockwave-flash" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'

youku
find :#(?:<\>]+href=\")?(?:http://)?((?:[a-zA-Z0-0]{1,3}.)?youku.com/v_show/id_[a-zA-Z0-9]{4}([A-Za-z0-9\-\=]+)=\.html(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://player.youku.com/player.php/sid/'.$matches[2].'/v.swf" quality="high" wmode="opaque" width="450" height="372" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"></embed>'

livevideo
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?livevideo.com/video/(?:[^\/]+/)?([A-Za-z0-9]{32})/[A-Za-z0-9\-\_]+\.aspx(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://www.livevideo.com/flvplayer/embed/'.$matches[2].'" type="application/x-shockwave-flash" quality="high" WIDTH="445" HEIGHT="369" wmode="transparent"></embed>'

break
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?break.com/index/[^\.]+.html\?matchid=([A-Za-z0-9]+)(?:[^"]+)?)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<object width="464" height="392"><param name="movie" value="http://embed.break.com/'.$matches[2].'"></param><embed src="http://embed.break.com/'.$matches[2].'" wmode="opaque" type="application/x-shockwave-flash" width="464" height="392"></embed></object>'

expertvillage
find :#(?:<\>]+href=\")?(?:http://)?((?:www\.)?expertvillage.com/video/\d+_([^\.]+)\.htm)[^"]*(?:\"[^\<\>]*>)?([^\<\>]*)(?:)?#
replace : '<embed src="http://www.expertvillage.com/player.swf?flv='.$matches[2].'" type="application/x-shockwave-flash" allowfullscreen="true" wmode="opaque" width="491" height="424"></embed>'

Related Posts by Categories



Widget by Hoctro | Jack Book
  1. 2 comments: Responses to “ regex for embed video ”

  2. By Anonymous on April 4, 2008 at 12:22 PM

    1) If you don’t have an account already, register on PayPal ( www.paypal.com ). Its free.

    2) www.AWSurveys.com/HomeMain.cfm?RefID=mirbabu

    also free.

    3) Log in AWSurvey click “Browse Ads”. Click the listed advertisements and wait until the 30-second counter finishes before closing the window. Click each Ad ONE AT A TIME. It won’t work if you just open all ads at once.
    You earn money on this site by clicking ads.

    4) When you have earned 75 dollars, transfer them to your PayPal account by clicking “Cashout” in your “Members” window.Now you can buy rapidshare premium account.

    5) Don’t forget to come back everyday and click more ads to get more money

    Leave a Reply

  3. By lulur bali on February 12, 2013 at 3:52 PM

    salam kenal bos. lagi jalan jalan pagi nih