this script working fine but for some reason stop to work . this script for zshare to Embedded video , <?php $sData = file('http://www.zshare.net/video/'.$_REQUEST['movie']); foreach ($sData as $line_num => $sData) { if(strstr(htmlspecialchars($sData), "zshare.net/stream/")){ $result = htmlspecialchars($sData); } } $start = strpos($result,"http"); $end = strpos($result,".mp4"); if(!$end){ $end = strpos($result,".flv"); } $path = substr($result,$start,$end); $path = split("'", $path); $sURL = $path[0]; $sEmbedCode = "<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='100%' height='100%' id='player'>" ."<param name='movie' value='backup.swf' />" ."<param name='FlashVars' value='videos=".$sURL."' />" ."<param name='allowfullscreen' value='true' />" ."<embed src='backup.swf' FlashVars='videos=".$sURL."' width='100%' height='100%' name='player'" ." type='application/x-shockwave-flash' allowfullscreen='true' pluginspage='http://www.macromedia.com/go/getflashplayer' />" ."</object>"; ?> <html> <head> <title></title> </head> <script type="text/javascript"> function light_manager(index, strength){ if(index == 0){ parent.dim_lights(strength) }else{ parent.raise_lights(strength) } } </script> <body> <?php echo $sEmbedCode; ?> </body> </html> PHP: any help ?
file() might not be the best function to use since some hosts do not allow file() or file_get_contents() but rather can use curl. IF you have shell access, try SSHing into your server and doing wget http://www.theurlyouwantograb.com There might be a chance that your server got blocked from accessing them.
Just try an echo after the first line to see if it can grab the data correctly: echo $sData; PHP: If it doesn't, you can just change the first line to this: (PHP5) $sData = file_get_contents('http://www.zshare.net/video/'. urlencode($_REQUEST['movie'])); PHP:
Actually, it's most likely that the site (zshare) has changed it's HTML. If you can supply a sample link it would be easier to tell.
this is what i use , i just embed this line in my page <iframe class="iframeswf" height=464 width=900 scrolling=no frameborder=0 src="/ZS2.php?6395865166b77eaf"> PHP: this is the id for the video > 6395865166b77eaf and it was working fine ,
You may want to try this instead: if (preg_match('/http:\/\/[^\.]+\.zshare\.net\/stream\/[a-z0-9\.\/\-\_]+\.(mp4|flv)/i', $contents, $match)) { $sURL = $match[0]; } else { $sURL = ''; } PHP:
what should i use im my html page ? <iframe class="iframeswf" height=464 width=900 scrolling=no frameborder=0 src="/ZS2.php?6395865166b77eaf"> PHP: or <iframe class="iframeswf" height=464 width=900 scrolling=no frameborder=0 src="/ZS2.php?movie=6395865166b77eaf"></iframe> PHP:
I tray that but it does not work , <?php $bDebug = isset($_GET['debug']) ? true : false; if( ! $bDebug) { ob_start(); } function getZShareVideoURL($sVideoID) { if($sData = file_get_contents('http://www.zshare.net/video/'.$sVideoID)) { if(1 === preg_match('~(http://[^.]+.zshare.net/stream/[^.]+\\..{3})~i', $sData, $aMatch)) { return $aMatch[0].'?'.rand(1000000, 9999999); } } return false; } $sEmbedCode = false; if(isset($_GET['movie']) && !empty($_GET['movie'])) { if($sURL = getZShareVideoURL($_GET['movie'])) { switch (strtolower(substr($sURL, -3, 3))) { #Insert incompatible types here. case 'exe': case 'msi': break; default: $sEmbedCode = sprintf( '<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="100%%" height="100%%" id="player"> <param name="movie" value="backup.swf" /> <param name="FlashVars" value="videos=%s" /> <param name="allowfullscreen" value="true" /> <embed src="backup.swf" FlashVars="videos=%s" width="100%%" height="100%%" name="player" type="application/x-shockwave-flash" allowfullscreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>', $sURL, $sURL ); break; } } } if( ! $bDebug) { ob_end_clean(); } ?> <html> <head> <title></title> </head> <body> <?php if($sEmbedCode !== false) { echo $sEmbedCode; } else { echo '<p>Sorry, that video is currently unavailable.</p>'; } ?> </body> </html> PHP:
I will pay for something work with flv files , No PAYPAL please , any other payments Company will be nice