Witam mam mały problem znalazłem w sieci taki skrypt jak poniżej który spełnia funkcje generatora plików flv z megavideo.
Ale niestety nie chce mi pobierać plików dochodzi tylko do 4 MB i się zatrzymuje.


  1. <?php
  2. function mv_decrypt($str_hex, $key1, $key2){
  3. $str_bin = "";
  4. // 1. Convert hexadecimal string to binary string
  5. for($i = 0; $i < 128; $i++){
  6. $str_bin .= floor(hexdec($str_hex[floor($i/4)])/pow(2,(3-($i%4))))%2;
  7. }
  8. // 2. Generate switch and XOR keys
  9. $key = Array();
  10. for ($i = 0; $i < 384; $i++){
  11. $key1 = ($key1 * 11 + 77213) % 81371;
  12. $key2 = ($key2 * 17 + 92717) % 192811;
  13. $key[$i] = ($key1 + $key2) % 128;
  14. }
  15. // 3. Switch bits positions
  16. for ($i = 256; $i >= 0; $i--){
  17. $temp = $str_bin[$key[$i]];
  18. $str_bin[$key[$i]] = $str_bin[$i%128];
  19. $str_bin[$i%128] = $temp;
  20. }
  21. // 4. XOR entire binary string
  22. for ($i = 0; $i < 128; $i++){
  23. $str_bin[$i] = $str_bin[$i] ^ $key[$i+256] & 1;
  24. }
  25. // 5. Convert binary string back to hexadecimal
  26. $str_hex = "";
  27. for($i = 0; $i < 32; $i++){
  28. $str_hex .= dechex(bindec(substr($str_bin, $i*4, 4)));
  29. }
  30. // 6. Return counted string
  31. return $str_hex;
  32. }
  33.  
  34. // Is set the "file" variable?
  35. if(isset($_GET["file"])){
  36. // Does player send video position?
  37. $pos = (isset($_GET["pos"]) ? intval($_GET["pos"]) : "");
  38. //Obtain Megavideo ID from link
  39. $megavideo_id = $_GET["file"];
  40. // Obtain Megavideo XML playlist file
  41. if ($content = @file_get_contents("http://www.megavideo.com/xml/videolink.php?&v=".$megavideo_id)){
  42. // Parameters which I want to obtain from XML;
  43. $parameters = Array("un", "k1", "k2", "s", "size");
  44. $success = true;
  45. // Obtain parameters from XML one by one
  46. for($i=0; $i<Count($parameters); $i++){
  47. $success = $success && preg_match('/ ' . $parameters[$i] . '="([^"]+)"/', $content, $match);
  48. $$parameters[$i] = $match[1];
  49. }
  50. if($success){
  51. // Count "dkey" from obtained parameters
  52. $dkey=mv_decrypt($un,$k1,$k2);
  53. // set URL address of video file
  54. $video_url = "http://www".$s.".megavideo.com/files/".$dkey."/".$pos;
  55. // Send headers to browser
  56. header("Content-Type: video/flv");
  57. header("Content-Disposition: attachment; filename=video.flv;" );
  58. header("Content-Length: ".$size);
  59. // Read video file from Megavideo server
  60. readfile($video_url);
  61. }
  62. }
  63. }
  64. ?>



A tu jeszcze drugi skrypt tylko kompletnie nie mam pojęcia jak go zastosować


  1. <?php
  2. if (!defined('RAPIDLEECH'))
  3. {
  4. require_once("index.html");
  5. }
  6. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  7.  
  8. $src = $_GET['link'];
  9. $clean_up = str_replace('http://www.megavideo.com/?v=', '', $src);
  10. $dorm = "http://www.megavideo.com/xml/player_login.php?u={$mu_cookie_user_value}&v=".$clean_up;
  11. $scrape = file_get_contents($dorm);
  12. if (preg_match('|<user type="premium" downloadurl="(http.*)" />|U', $scrape, $result)) {
  13. $insert = urldecode($result[1]);
  14. $quiz = $insert;
  15. $Url = parse_url($quiz);
  16. $FileName = !$FileName ? basename($Url["path"]) : $FileName;
  17.  
  18. insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($Referer)."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".urlencode($LINK).($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "")."&auth=".$auth.($pauth ? "&pauth=$pauth" : ""));
  19.  
  20. }
  21. $codl=cut_str($page,'flashvars.v = "','";');
  22. if (!$codl){html_error("bud link","0");}
  23. $lkvid="http://www.megavideo.com/xml/videolink.php?v=".$codl;
  24. $url=parse_url($lkvid);
  25. $xml = geturl($url["host"], $url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  26.  
  27. $xmld=urldecode($xml);
  28. $vs=cut_str($xml,'" s="','"');
  29. $vun=cut_str($xml,'" un="','"');
  30. $vk1=cut_str($xml,'" k1="','"');
  31. $vk2=cut_str($xml,'" k2="','"');
  32. $FileName=cut_str($xml,'" title="','"').".flv";
  33. if ($FileName ==""){
  34. $FileName=basename($dwn).".flv";
  35. }
  36. $id=ddm($vun,$vk1,$vk2);
  37.  
  38. $dwn="http://www".$vs.".megavideo.com/files/".$id."/";
  39. $Url = parse_url($dwn);
  40.  
  41. insert_location ( "$PHP_SELF?filename=" . ( $FileName ) . "&host=" . $Url ["host"] ."&port=".$Url["port"]."&path=" . urlencode ( $Url ["path"] . ($Url ["query"] ? "?" . $Url ["query"] : "") ) . "&referer=" . urlencode ( $Referer ) . "&cookie=" . urlencode ( $cookie ) . "&email=" . ($_GET ["domail"] ? $_GET ["email"] : "") . "&partSize=" . ($_GET ["split"] ? $_GET ["partSize"] : "") . "&method=" . $_GET ["method"] . "&proxy=" . ($_GET ["useproxy"] ? $_GET ["proxy"] : "") . "&saveto=" . $_GET ["path"] . "&link=" . urlencode ( $LINK ) . ($_GET ["add_comment"] == "on" ? "&comment=" . urlencode ( $_GET ["comment"] ) : "") . ($pauth ? "&pauth=$pauth" : "") );
  42. function ddm($str, $key1, $key2){$_loc1 = array();for ($_loc3 = 0; $_loc3 < strlen($str); ++$_loc3){switch ($str{$_loc3}){case "0":{$_loc1[]="0000";break;}case "1":{$_loc1[]="0001";break;}case "2":{$_loc1[]="0010";break;}case "3":{$_loc1[]="0011";break;}case "4":{$_loc1[]="0100";break;}case "5":{$_loc1[]="0101";break;}case "6":{$_loc1[]="0110";break;}case "7":{$_loc1[]="0111";break;}case "8":{$_loc1[]="1000";break;}case "9":{$_loc1[]="1001";break;}case "a":{$_loc1[]="1010";break;}
  43. case "b":{$_loc1[]="1011";break;}case "c":{$_loc1[]="1100";break;}case "d":{$_loc1[]="1101";break;}case "e":{$_loc1[]="1110";break;}case "f":{$_loc1[]="1111";break;}} } $_loc1 = join("",$_loc1);$_loc1 = str_split($_loc1);$_loc6 = array();$kx = 0;for ($_loc3 = 0; $_loc3 < 384; ++$_loc3){$key1 = ($key1 * 11 + 77213) % 81371;$key2 = ($key2 * 17 + 92717) % 192811;$_loc6[$_loc3] = ($key1 + $key2) % 128;} for ($_loc3 = 256; $_loc3 >= 0; --$_loc3){$_loc5 = $_loc6[$_loc3];$_loc4 = $_loc3 % 128;
  44. $_loc8 = $_loc1[$_loc5];$_loc1[$_loc5] = $_loc1[$_loc4];$_loc1[$_loc4] = $_loc8;} for ($_loc3 = 0; $_loc3 < 128; ++$_loc3){$_loc1[$_loc3] = $_loc1[$_loc3] ^ $_loc6[$_loc3 + 256] & 1;} $_loc12 = join($_loc1,"");$_loc7 = array();for ($_loc3 = 0; $_loc3 < strlen($_loc12); $_loc3 = $_loc3 + 4){$_loc9 = substr($_loc12,$_loc3, 4);$_loc7[]=$_loc9;} $_loc2 = array();for ($_loc3 = 0; $_loc3 < count($_loc7); ++$_loc3){switch ($_loc7[$_loc3]){case "0000":{$_loc2[]="0";break;}case "0001":{$_loc2[]="1";break;}
  45. case "0010":{$_loc2[]="2";break;}case "0011":{$_loc2[]="3";break;}case "0100":{$_loc2[]="4";break;}case "0101":{$_loc2[]="5";break;}case "0110":{$_loc2[]="6";break;}case "0111":{$_loc2[]="7";break;}case "1000":{$_loc2[]="8";break;}case "1001":{$_loc2[]="9";break;}case "1010":{$_loc2[]="a";break;}case "1011":{$_loc2[]="b";break;}case "1100":{$_loc2[]="c";break;}case "1101":{$_loc2[]="d";break;}case "1110":{$_loc2[]="e";break;}case "1111":{$_loc2[]="f";break;}} } return (join($_loc2,""));}
  46.  
  47. /*
  48. megavideo download plug-in written by kaox 25/04/09
  49. Premium download plug-in written by mrbrownee70 06/05/09
  50. */
  51.  
  52. ?>