Сваляне от Vbox7
Принципа на работа е прост. Взима се адреса на клипчето и се обработва, докато се вземе id-то. След това id-то се използва за да се покаже самия клип и за да се даде линк към flv файла. Ето го и самия скрипт.Това е кода:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Сваляй клипчета от Vbox7</title> <meta http-equiv="content-type" content="text/html; charset=windows-1251"> <style type="text/css"> div.main { width: 400px; } input.vaddress { width: 100%; border: 1px solid #888; } </style> <script type="text/javascript"> function download() { var download_form = document.forms["download"]; var video_address = download_form.elements["vaddress"].value; var video_address = video_address.replace("www.", ""); // we remove the www var video_id = video_address.replace("[url]http://vbox7.com/play:[/url]", ""); // if there is not www var flash_movie = document.getElementById("flash_movie"); flash_movie.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="[url]http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=[/url] 7,0,0,0" width="450" height="403"><param name="movie" value="[url]http://i47.vbox7.com/player/ext.swf?vid=[/url]'+video_id+'"><param name="quality" value="high"><embed src="[url]http://i47.vbox7.com/player/ext.swf?vid=[/url]'+video_id+'" quality="high" pluginspage="[url]http://www.macromedia.com/go/getflashplayer[/url]" type="application/x-shockwave-flash" width="450" height="403"></embed></object>'; var download_link = document.getElementById("download_link"); download_link.innerHTML = '<a href="[url]http://media.vbox7.com/s/[/url]'+video_id.substr(0, 2)+'/'+video_id+'.flv">Свали това клипче!</a>'; } </script> </head> <body> <center> <div class="main"> <form name="download" method="POST" action="javascript: download();"> <table><tr> <td width="300"> <input type="text" name="vaddress" class="vaddress"> </td> <td width="100"> <input type="submit" value="Сваляй"> </td> </tr></table> </form> <br><br> <div id="download_link"></div> <br><br> <div id="flash_movie"> <!-- flash --> </div> </div> </center> </body> </html>
Демо: Сваляне от Vbox7 [demo.webmake.org]
