PageRenderTime 56ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/filme/php/link.php

https://code.google.com/p/hdforall/
PHP | 968 lines | 945 code | 0 blank | 23 comment | 46 complexity | 1705316be603c64d08782184af47dc4a MD5 | raw file
  1. #!/usr/local/bin/Resource/www/cgi-bin/php
  2. <?php
  3. error_reporting(0);
  4. $filelink = $_GET["file"];
  5. $filelink=urldecode($filelink);
  6. if (strpos($filelink,"is.gd") !==false) {
  7. $a = @get_headers($filelink);
  8. //print_r ($a);
  9. $l=$a[6];
  10. $a1=explode("Location:",$l);
  11. $filelink=trim($a1[1]);
  12. }
  13. if (strpos($filelink,"adf.ly") !==false) {
  14. $h1=file_get_contents($filelink);
  15. $filelink=str_between($h1,"var url = '","'");
  16. $a = @get_headers($filelink);
  17. //print_r ($a);
  18. $l=$a[9];
  19. $a1=explode("Location:",$l);
  20. $filelink=trim($a1[1]);
  21. }
  22. if (strpos($filelink,"moovie.cc") !== false) {
  23. $a = @get_headers($filelink);
  24. $l=$a[10];
  25. $a1=explode("Location:",$l);
  26. $filelink=trim($a1[1]);
  27. }
  28. function str_between($string, $start, $end){
  29. $string = " ".$string; $ini = strpos($string,$start);
  30. if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini;
  31. return substr($string,$ini,$len);
  32. }
  33. function unpack_DivXBrowserPlugin($n_func,$html_cod,$sub=false) {
  34. $f=explode("return p}",$html_cod);
  35. $e=explode("'.split",$f[$n_func]);
  36. $ls=$e[0];
  37. //echo $ls;
  38. $a=explode(";",$ls);
  39. //print_r($a); //for debug only
  40. $a1=explode("'",$a[count($a)-1]); //char list for replace
  41. $b1=explode(",",$a1[1]);
  42. $base_enc=$b1[1];
  43. //echo $base_enc;
  44. $w=explode("|",$a1[2]);
  45. //print_r ($w);
  46. $ch="0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz";
  47. $ch="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  48. $ch="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  49. $fl="";
  50. for ($i=0;$i<count($a)-1;$i++) {
  51. $fl=$fl.$a[$i];
  52. }
  53. $r="";
  54. $x=strlen($fl);
  55. for ($i=0;$i<strlen($fl);$i++) {
  56. if (!preg_match('/[A-Za-z0-9]/',$fl[$i])) { //nu e alfanumeric
  57. $r=$r.$fl[$i];
  58. } elseif (($i<$x) && (preg_match('/[A-Za-z0-9]/',$fl[$i])) && (preg_match('/[A-Za-z0-9]/',$fl[$i+1]))) {
  59. $pos=strpos($ch,$fl[$i+1]);
  60. $pos=$base_enc*$fl[$i] + $pos;
  61. if ($w[$pos] <> "")
  62. $r=$r.$w[$pos];
  63. else
  64. $r=$r.$fl[$i].$fl[$i+1];
  65. } elseif (($i>0) && (preg_match('/[A-Za-z0-9]/',$fl[$i])) && (preg_match('/[A-Za-z0-9]/',$fl[$i-1]))) {
  66. // nothing
  67. } else {
  68. $pos=strpos($ch,$fl[$i]);
  69. if ($w[$pos] <> "")
  70. $r=$r.$w[$pos];
  71. else
  72. $r=$r.$fl[$i];
  73. }
  74. }
  75. $r=str_replace("\\","",$r);
  76. //echo $r;
  77. $ret_val=str_between($r,'param name="src"value="','"');
  78. if ($ret_val == "")
  79. $ret_val = str_between($r,"file','","'");
  80. if ($sub==true) {
  81. $srt=str_between($r,"captions.file','","'");
  82. $srt = str_replace(" ","%20",$srt);
  83. $ret_val=$ret_val.",".$srt;
  84. }
  85. return $ret_val;
  86. }
  87. function str_prep($string){
  88. $string = str_replace(' ','%20',$string);
  89. $string = str_replace('[','%5B',$string);
  90. $string = str_replace(']','%5D',$string);
  91. $string = str_replace('%3A',':',$string);
  92. $string = str_replace('%2F','/',$string);
  93. $string = str_replace('#038;','',$string);
  94. $string = str_replace('&amp;','&',$string);
  95. return $string;
  96. }
  97. //peteava
  98. function r() {
  99. $i=mt_rand(4096,0xffff);
  100. $j=mt_rand(4096,0xffff);
  101. return dechex($i).dechex($j);
  102. }
  103. function zeroFill($a,$b) {
  104. if ($a >= 0) {
  105. return bindec(decbin($a>>$b)); //simply right shift for positive number
  106. }
  107. $bin = decbin($a>>$b);
  108. $bin = substr($bin, $b); // zero fill on the left side
  109. $o = bindec($bin);
  110. return $o;
  111. }
  112. function crunch($arg1,$arg2) {
  113. $local4 = strlen($arg2);
  114. while ($local5 < $local4) {
  115. $local3 = ord(substr($arg2,$local5));
  116. $arg1=$arg1^$local3;
  117. $local3=$local3%32;
  118. $arg1 = ((($arg1 << $local3) & 0xFFFFFFFF) | zeroFill($arg1,(32 - $local3)));
  119. $local5++;
  120. }
  121. return $arg1;
  122. }
  123. function peteava($movie) {
  124. $seedfile=file_get_contents("http://content.peteava.ro/seed/seed.txt");
  125. $t1=explode("=",$seedfile);
  126. $seed=$t1[1];
  127. if ($seed == "") {
  128. return "";
  129. }
  130. $r=r();
  131. $s = hexdec($seed);
  132. $local3 = crunch($s,$movie);
  133. $local3 = crunch($local3,"0");
  134. $local3 = crunch($local3,$r);
  135. return strtolower(dechex($local3)).$r;
  136. }
  137. /** end peteava **/
  138. function rapidmov($string) {
  139. //http://www1-45-37.rapidmov.net/cgi-bin/dl.cgi/xqawnjsw4l2yogppfwyu7nysssq6s62b7ee3v6crve/video.flv
  140. $h = file_get_contents($string);
  141. $g=ord("g");
  142. $f=explode("return p}",$h);
  143. $e=explode("'.split",$f[1]);
  144. $t=$e[0];
  145. $a=explode(";",$t);
  146. $w=explode("|",$a[9]);
  147. $t1=explode("'",$a[4]);
  148. $fl= $t1[3];
  149. $s1=explode("/",$fl);
  150. $r="";
  151. for ($i=0;$i<strlen($fl)-1;$i++) {
  152. if (preg_match("/[A-Za-z0-9_]/",$fl[$i])) {
  153. $r=$r.$w[cv($fl[$i])];
  154. } else {
  155. $r=$r.$fl[$i];
  156. }
  157. }
  158. return $r;
  159. }
  160. //if (!preg_match_all('/\{"d":(false|true),"l":"([^"]+)","u":"([^"]+)"/i', $page, $st))
  161. function videobb($l) {
  162. $ch = curl_init();
  163. curl_setopt($ch, CURLOPT_URL, $l);
  164. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  165. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
  166. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  167. curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
  168. curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
  169. $page = curl_exec($ch);
  170. curl_close($ch);
  171. //preg_match_all('/\{"d":(false|true),"l":"([^"]+)","u":"([^"]+)"\}/i', $page, $st);
  172. preg_match_all('/\{"d":(false|true),"l":"([^"]+)","u":"([^"]+)"/i', $page, $st);
  173. $stream = array();
  174. for ($i = 0; $i < count($st[0]); $i++) {
  175. $stream[$st[2][$i]] = array(($st[1][$i] == "true" ? true : false), base64_decode($st[3][$i]));
  176. }
  177. if (count($stream) > 1) {
  178. foreach ($stream as $st => $da) {
  179. if ($da[0] == true) {
  180. $fl=$da[1];
  181. } else {
  182. $fl=$da[1]; // ?????
  183. }
  184. }
  185. } else {
  186. $qs = array_rand($stream);
  187. $fl = $stream[$qs][1];
  188. }
  189. return $fl;
  190. }
  191. function vk($string) {
  192. if (strpos($string,"video_ext.php") === false) {
  193. $h = file_get_contents($string);
  194. $t1=explode("nvar vars",$h);
  195. $l=$t1[1];
  196. $uid=str_between($l,'\"uid\":\"','\"');
  197. $host=str_between($l,'"host\":\"','\"');
  198. $host=str_replace("\\/","/",$host);
  199. $host=str_replace("\\/","/",$host);
  200. $host=str_replace("\/","/",$host);
  201. $vtag=str_between($l,'"vtag\":\"','\"');
  202. $r=$host."u".$uid."/video/".$vtag.".360.mp4";
  203. } else {
  204. $baza = file_get_contents($string);
  205. $host = str_between($baza,"var video_host = '","'");
  206. $uid = str_between($baza,"var video_uid = '","'");
  207. $vtag = str_between($baza,"var video_vtag = '","'");
  208. $hd = str_between($baza,"var video_max_hd = '","'");
  209. $r = $host."u".$uid."/video/".$vtag.".360.mp4";
  210. if ($hd == "0") {
  211. $r = $host."u".$uid."/video/".$vtag.".240.mp4";
  212. }
  213. }
  214. return $r;
  215. }
  216. function youtube($file) {
  217. if (preg_match('%(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $file, $match)) {
  218. $l ="http://www.youtube.com/watch?v=".$match[1];
  219. $r=file_get_contents("http://127.0.0.1/cgi-bin/scripts/util/yt.php?file=".urlencode($l));
  220. }
  221. return $r;
  222. }
  223. function flvz($string) {
  224. if (strpos($string,"embed") === false) {
  225. $string=str_replace("video","embed",$string);
  226. }
  227. $h = file_get_contents($string);
  228. $r = str_between($h,'"url": "','"');
  229. return $r;
  230. }
  231. function putlocker($string) {
  232. //http://www.putlocker.com/embed/067DF715716F10C5
  233. //http://www.putlocker.com/file/067DF715716F10C5
  234. $string=str_replace("file","embed",$string);
  235. $id=substr(strrchr($string,"/"),1);
  236. $ch = curl_init();
  237. curl_setopt($ch, CURLOPT_URL, $string);
  238. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  239. curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookies.txt');
  240. curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
  241. $h = curl_exec($ch);
  242. curl_close($ch);
  243. $t1=explode('form method="post"',$h);
  244. $t2=explode('value="',$t1[1]);
  245. $t3=explode('"',$t2[1]);
  246. $hash=$t3[0];
  247. $post="fuck_you=".$hash."&confirm=Close+Ad+and+Watch+as+Free+User";
  248. //echo $post;
  249. //hash=fe41ab2306be4d45&confirm=Close+Ad+and+Watch+as+Free+User
  250. //hash=0f44a928fe962fd2&confirm=Continue+as+Free+User
  251. //fuck_you=9ccabf34d9a6928e&confirm=Close+Ad+and+Watch+as+Free+User
  252. $ch = curl_init();
  253. curl_setopt($ch, CURLOPT_URL, $string);
  254. curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
  255. curl_setopt ($ch, CURLOPT_POST, 1);
  256. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  257. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  258. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  259. $h = curl_exec($ch);
  260. curl_close($ch);
  261. $id=str_between($h,"playlist: '","'");
  262. //$url="http://www.putlocker.com/get_file.php?embed_stream=".$id;
  263. ///get_file.php?embed_stream=MDY3REY3MTU3MTZGMTBDNStlNTY1Y2EwNDcyZjYwZjUy
  264. if (strpos($string,"putlocker") !==false) {
  265. $url="http://www.putlocker.com".$id;
  266. } elseif (strpos($string,"sockshare") !== false) {
  267. $url="http://www.sockshare.com".$id;
  268. }
  269. $ch = curl_init();
  270. curl_setopt($ch, CURLOPT_URL, $url);
  271. curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookies.txt');
  272. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  273. $h = curl_exec($ch);
  274. curl_close($ch);
  275. $t1=explode('media:content url="',$h);
  276. $t2=explode('"',$t1[2]);
  277. $r = $t2[0];
  278. return $r;
  279. }
  280. function vix($k,$char_rep,$pos_link,$h,$fn) {
  281. $f=explode("return p}",$h);
  282. $e=explode("'.split",$f[$k]);
  283. $ls=$e[0];
  284. preg_match("/(\|)((s|w)\d{2})\|/",$ls,$m);
  285. $server=$m[2];
  286. preg_match("/(\|)([a-z0-9]{45})\|/",$ls,$m);
  287. $hash=$m[2];
  288. preg_match("/(\|)(182|384|364)\|/",$ls,$m);
  289. $port=$m[2];
  290. preg_match("/(\|)(divxden|vidxden)\|/",$ls,$m);
  291. $serv_name=$m[2];
  292. $r="http://".$server.".".$serv_name.".com:".$port."/d/".$hash."/".$fn;
  293. return $r;
  294. }
  295. function uploadc($string) {
  296. $ch = curl_init($string);
  297. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  298. curl_setopt($ch, CURLOPT_REFERER, $string);
  299. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  300. $h = curl_exec($ch);
  301. $ipcount_val=str_between($h,'"ipcount_val" value="','"');
  302. $id=str_between($h,'"id" value="','"');
  303. $fname=str_between($h,'"fname" value="','"');
  304. $post="ipcount_val=".$ipcount_val."&op=download2&usr_login=&id=".$id."&fname=".$fname."&referer=&method_free=Slow+access";
  305. //ipcount_val=10&op=download2&usr_login=&id=a2baprw26l3m&fname=np-prophezeiung-xvid.avi&referer=&method_free=Slow+access
  306. //ipcount_val=10&op=download2&usr_login=&id=pia0ng8rrzqk&fname=om-die.geschichte.vom.goldenen.taler-xvid.avi&referer=&method_free=Slow+access
  307. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  308. curl_setopt($ch, CURLOPT_REFERER, $string);
  309. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  310. curl_setopt ($ch, CURLOPT_POST, 1);
  311. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  312. $h = curl_exec($ch);
  313. $r=unpack_DivXBrowserPlugin(2,$h);
  314. return $r;
  315. }
  316. //***************Here we start**************************************
  317. $filelink=str_prep($filelink);
  318. if ((strpos($filelink,"vidxden") !==false) || (strpos($filelink,"divxden") !==false)) {
  319. if (strpos($filelink,"embed") === false) {
  320. $t=explode("/",$filelink);
  321. $id= $t[3];
  322. $filelink="http://www.vidxden.com/embed-".$id."-width-653-height-362.html";
  323. }
  324. $h=file_get_contents($filelink);
  325. $link=unpack_DivXBrowserPlugin(1,$h);
  326. } elseif (strpos($filelink,"vidbux") !==false) {
  327. /*
  328. if (strpos($filelink,"embed") === false) {
  329. $t=explode("/",$filelink);
  330. $id= $t[3];
  331. $filelink=$t[0]."/".$t[1]."/".$t[2]."/"."embed-".$id."-width-653-height-362.html";
  332. }
  333. echo $filelink;
  334. */
  335. //op=download1&usr_login=&id=9e889zt1l1ba&fname=Rush.Hour.3.2007i.flv&referer=&method_free=Continue+to+Video
  336. $ch = curl_init($filelink);
  337. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  338. curl_setopt($ch, CURLOPT_REFERER, $filelink);
  339. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  340. $h = curl_exec($ch);
  341. $id=str_between($h,'"id" type="hidden" value="','"');
  342. $fname=str_between($h,'"fname" type="hidden" value="','"');
  343. $post="op=download1&usr_login=&id=".$id."&fname=".$fname."&referer=&method_free=Continue+to+Video";
  344. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  345. curl_setopt($ch, CURLOPT_REFERER, $string);
  346. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  347. curl_setopt ($ch, CURLOPT_POST, 1);
  348. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  349. $h = curl_exec($ch);
  350. curl_close($ch);
  351. $link=unpack_DivXBrowserPlugin(1,$h);
  352. } elseif (strpos($filelink,'movreel') !==false) {
  353. preg_match('/movreel\.com\/(embed\/)?+([\w\-]+)/', $filelink, $m);
  354. $id=$m[2];
  355. $filelink = "http://movreel.com/embed/".$id;
  356. $h = file_get_contents($filelink);
  357. $link=str_between($h,'<param name="src" value="','"');
  358. } elseif (strpos($filelink,'videoweed') !==false) {
  359. if (strpos($filelink,"embed") !== false) {
  360. preg_match('/(v=)([A-Za-z0-9_]+)/', $filelink, $m);
  361. $id=$m[2];
  362. $s=explode("/",$filelink);
  363. $filelink="http://".$s[2]."/embed.php?v=".$id."&amp;width=900&amp;height=600";
  364. }
  365. $h = file_get_contents($filelink);
  366. $f = str_between($h,'flashvars.file="','"');
  367. $k = str_between($h,'flashvars.filekey="','"');
  368. $l="http://www.videoweed.es/api/player.api.php?user=undefined&codes=undefined&pass=undefined&file=".$f."&key=".$k;
  369. //$l=str_replace("&","&amp;",$l);
  370. $h=file_get_contents($l);
  371. $link=str_between($h,"url=","&");
  372. } elseif (strpos($filelink,'novamov') !==false) {
  373. if (strpos($filelink,"embed") !== false) {
  374. preg_match('/(v=)([A-Za-z0-9_]+)/', $filelink, $m);
  375. $id=$m[2];
  376. $s=explode("/",$filelink);
  377. //http://embed.novamov.com/embed.php?width=728&height=400&v=yi18gc4a62gsu&px=1
  378. $filelink="http://".$s[2]."/embed.php?v=".$id."&amp;width=600&amp;height=480";
  379. }
  380. $h=file_get_contents($filelink);
  381. $file=str_between($h,'flashvars.file="','"');
  382. $filekey=str_between($h,'flashvars.filekey="','"');
  383. $l="http://www.novamov.com/api/player.api.php?user=undefined&file=".$file."&pass=undefined&key=".urlencode($filekey);
  384. $h=file_get_contents($l);
  385. $link=str_between($h,"url=","&");
  386. } elseif (strpos($filelink, 'videobb.com') !== false) {
  387. $id=substr(strrchr($filelink,"/"),1);
  388. $l="http://www.sheepser.com/vb23.php?s1=".$id;
  389. $h=file_get_contents($l);
  390. $t1=explode('url="',$h);
  391. $t2=explode('"',$t1[1]);
  392. $link=$t2[0];
  393. if (strpos($link,"videobb") === false) {
  394. $filelink="http://www.videobb.com/player_control/settings.php?v=".$id;
  395. $link=videobb($filelink);
  396. }
  397. } elseif (strpos($filelink, 'videozer.com') !== false) {
  398. $id=substr(strrchr($filelink,"/"),1);
  399. $l="http://www.sheepser.com/vz23.php?s1=".$id;
  400. $h=file_get_contents($l);
  401. $t1=explode('url="',$h);
  402. $t2=explode('"',$t1[1]);
  403. $link=$t2[0];
  404. if (strpos($link,"videozer") === false) {
  405. $filelink="http://www.videozer.com/player_control/settings.php?v=".$id;
  406. $link=videobb($filelink);
  407. }
  408. } elseif ((strpos($filelink, 'vk.com') !== false) || (strpos($filelink, 'vkontakte.ru') !== false)) {
  409. $link=vk($filelink);
  410. } elseif (strpos($filelink, 'movshare') !== false){
  411. preg_match('/(v=)([A-Za-z0-9_]+)/', $filelink, $m);
  412. $id=$m[2];
  413. if ($id == "") {
  414. if (strpos($filelink,"?") !==false) {
  415. $a=explode("?",$filelink);
  416. $rest = substr($a[0], 0, -1);
  417. $id= substr(strrchr($rest,"/"),1);
  418. } else {
  419. $id = substr(strrchr($filelink,"/"),1);
  420. }
  421. }
  422. $filelink = "http://embed.movshare.net/embed.php?v=".$id;
  423. $baza = file_get_contents($filelink);
  424. $key=str_between($baza,'flashvars.filekey="','"');
  425. if ($key <> "") {
  426. $l="http://www.movshare.net/api/player.api.php?user=undefined&codes=undefined&key=";
  427. $l=$l.urlencode($key)."&pass=undefined&file=".$id;
  428. $b=file_get_contents($l);
  429. $link=str_between($b,"url=","&");
  430. } else {
  431. $link = str_between($baza,'file="','"');
  432. if ($link == "") {
  433. $link=str_between($baza,'name="src" value="','"');
  434. }
  435. if ($link == "") {
  436. $link=str_between($baza,'src" value="','"');
  437. }
  438. }
  439. } elseif (strpos($filelink, 'youtu') !== false){
  440. $link=youtube($filelink);
  441. } elseif (strpos($filelink, 'flvz.com') !== false){
  442. $link=flvz($filelink);
  443. } elseif (strpos($filelink, 'rapidmov.net') !== false){
  444. //$link=rapidmov($filelink);
  445. $h = file_get_contents($filelink);
  446. $link=unpack_DivXBrowserPlugin(1,$h);
  447. } elseif (strpos($filelink, 'putlocker.com') !== false){
  448. $link=putlocker($filelink);
  449. } elseif (strpos($filelink, 'sockshare.com') !== false){
  450. $link=putlocker($filelink);
  451. } elseif (strpos($filelink, 'peteava.ro/embed') !== false) {
  452. preg_match('/(video\/)([A-Za-z0-9_]+)/', $filelink, $m);
  453. $id=$m[2];
  454. $filelink = "http://www.peteava.ro/embed/video/".$id;
  455. $h = file_get_contents($filelink);
  456. $id = str_between($h,"hd_file=","&");
  457. if ($id == "") {
  458. $id = str_between($h,"stream.php&file=","&");
  459. }
  460. if ($id <> $last_peteava) {
  461. $last_peteava=$id;
  462. $token = peteava($id);
  463. $link = "http://content.peteava.ro/video/".$id."?start=0&token=".$token;
  464. }
  465. } elseif (strpos($filelink, 'peteava.ro/id') !== false) {
  466. $h = file_get_contents($filelink);
  467. $id = str_between($h,"hd_file=","&");
  468. if ($id == "") {
  469. $id = str_between($h,"stream.php&file=","&");
  470. }
  471. if ($id <> $last_peteava) {
  472. $last_peteava=$id;
  473. $token = peteava($id);
  474. $link = "http://content.peteava.ro/video/".$id."?start=0&token=".$token;
  475. }
  476. } elseif (strpos($filelink, 'content.peteava.ro') !== false) {
  477. $id = str_between($h,"hd_file=","&");
  478. if ($id == "") {
  479. $id = str_between($filelink,"stream.php&file=","&");
  480. }
  481. $p=strpos($id,"."); //cinemaxx.ro
  482. $id1= substr($id,0, $p);
  483. $id2=substr($id,$p,4);
  484. $id= $id1.$id2;
  485. if ($id <> $last_peteava) {
  486. $last_peteava=$id;
  487. $token = peteava($id);
  488. $link = "http://content.peteava.ro/video/".$id."?start=0&token=".$token;
  489. }
  490. } elseif (strpos($filelink,'vimeo.com') !==false){
  491. //http://player.vimeo.com/video/16275866
  492. if (strpos($filelink,"player.vimeo.com") !==false) {
  493. $id=substr(strrchr($filelink,"/"),1);
  494. $link="http://127.0.0.1/cgi-bin/translate?stream,,http://vimeo.com/".$id;
  495. } else {
  496. $link="http://127.0.0.1/cgi-bin/translate?stream,,".$filelink;
  497. }
  498. } elseif (strpos($filelink, 'googleplayer.swf') !== false) {
  499. $t1 = explode("docid=", $filelink);
  500. $t2 = explode("&",$t1[1]);
  501. $link = "http://127.0.0.1/cgi-bin/translate?stream,,http://video.google.com/videoplay?docid=".$t2[0];
  502. } elseif (strpos($filelink, 'filebox.ro/get_video') !== false) {
  503. $s = str_between($filelink,"videoserver",".");
  504. $f = str_between($filelink,"key=","&");
  505. $link = "http://static.filebox.ro/filme/".$s."/".$f.".flv";
  506. } elseif (strpos($filelink, 'megavideo.com') !== false) {
  507. $link="http://127.0.0.1/cgi-bin/scripts/php1/mv.cgi?v=".megavideo($filelink);
  508. } elseif (strpos($filelink, 'videobam.com/widget') !== false) {
  509. //http://videobam.com/widget/Xykqy/3"
  510. $h = file_get_contents($filelink);
  511. $link=str_between($h,',"url":"','"');
  512. $link=str_replace("\\","",$link);
  513. } elseif (strpos($filelink, 'video.rol.ro') !== false) {
  514. //http://video.rol.ro/embed/js/55307.js
  515. //http://video.rol.ro/embed/iframe/56071
  516. //http://video.rol.ro/trollhunter-2010-www-onlinemoca-com-55307.htm
  517. if (strpos($filelink,"embed") !==false) {
  518. $r1 = substr(strrchr($filelink, "/"), 1);
  519. $l= "http://video.rol.ro/embed/js/".$r1.".js";
  520. } else {
  521. $r1 = substr(strrchr($filelink, "-"), 1);
  522. $r2=explode(".",$r1);
  523. $l= "http://video.rol.ro/embed/js/".$r2[0].".js";
  524. }
  525. $h = file_get_contents($l);
  526. $link=str_between($h,"file': '","'");
  527. } elseif (strpos($filelink, 'divxstage.net') !== false) {
  528. //divxstage.net/video/canc73f7kgvbt
  529. $h = file_get_contents($filelink);
  530. $link=str_between($h,'param name="src" value="','"');
  531. if ($link == "") {
  532. $link=str_between($h,'addVariable("file","','"');
  533. }
  534. } elseif (strpos($filelink, 'divxstage.eu') !== false) {
  535. //http://www.divxstage.eu/video/oisekelygcrnb
  536. //http://www.divxstage.eu/api/player.api.php?key=78%2E96%2E189%2E71%2D0158d8005886f55b17aa976b4b596404&user=undefined&codes=undefined&pass=undefined&file=0nm6yadbatt77
  537. $h = file_get_contents($filelink);
  538. $p1=str_between($h,'flashvars.filekey="','"');
  539. $p2=str_between($h,'flashvars.file="','"');
  540. if ($p1 == "") {
  541. $link=str_between($h,'param name="src" value="','"');
  542. if ($link == "") {
  543. $link=str_between($h,'addVariable("file","','"');
  544. }
  545. } else {
  546. $l1="http://www.divxstage.eu/api/player.api.php?key=".urlencode($p1)."&user=undefined&codes=undefined&pass=undefined&file=".$p2;
  547. $h = file_get_contents($l1);
  548. $link=str_between($h,"url=","&");
  549. }
  550. } elseif ((strpos($filelink, 'fastupload.rol.ro') !== false) || (strpos($filelink, 'fastupload.ro') !== false)) {
  551. $h = file_get_contents($filelink);
  552. $link=str_between($h,"file': '","'");
  553. } elseif (strpos($filelink, 'zetshare.net') !== false) {
  554. $h = file_get_contents($filelink);
  555. $link=str_between($h,"'file', '","'");
  556. } elseif (strpos($filelink, 'ufliq.com') !== false) {
  557. $h = file_get_contents($filelink);
  558. $link=str_between($h,"url: '","'");
  559. if ($link == "") {
  560. $link=unpack_DivXBrowserPlugin(1,$h);
  561. }
  562. } elseif (strpos($filelink, 'stagero.eu') !== false) {
  563. //http://www.stagero.eu/api/player.api.php?codes=1&key=78%2E96%2E189%2E71%2D43400f4737713449ec249d9baf1e16f9&pass=undefined&user=undefined&file=pq34kgvq7gn26
  564. $h = file_get_contents($filelink);
  565. $p1=str_between($h,'flashvars.filekey="','"');
  566. $p2=str_between($h,'flashvars.file="','"');
  567. $l1="http://www.stagero.eu/api/player.api.php?codes=1&key=".urlencode($p1)."&pass=undefined&user=undefined&file=".$p2;
  568. $h = file_get_contents($l1);
  569. $link=str_between($h,"url=","&");
  570. } elseif (strpos($filelink, 'mixturevideo.com') !== false) {
  571. $h = file_get_contents($filelink);
  572. $p1=str_between($h,"file=","&");
  573. $p2=str_between($h,"streamer=",'"');
  574. $link=$p2."&file=".$p1;
  575. } elseif (strpos($filelink, 'ovfile.com') !== false) {
  576. if (strpos($filelink,"embed") === false) {
  577. $t1=explode("/",$filelink);
  578. $id=$t1[3];
  579. $filelink="http://ovfile.com/embed-".$id."-728x340.html";
  580. }
  581. $h = file_get_contents($filelink);
  582. $link=unpack_DivXBrowserPlugin(2,$h);
  583. } elseif (strpos($filelink, 'trilulilu') !== false) {
  584. $h = file_get_contents($filelink);
  585. if (strpos($filelink,"embed") === false) {
  586. $userid = str_between($h, 'userid":"', '"');
  587. $hash = str_between($h, 'hash":"', '"');
  588. $server = str_between($h, 'server":"', '"');
  589. } else {
  590. $userid = str_between($h, 'userid=', '&');
  591. $hash = str_between($h, 'hash=', '&');
  592. $server = str_between($h, 'server=', '"');
  593. }
  594. $link1="http://fs".$server.".trilulilu.ro/stream.php?type=video&amp;source=site&amp;hash=".$hash."&amp;username=".$userid."&amp;key=ministhebest";
  595. $link = $link1."&amp;format=mp4-720p";
  596. $AgetHeaders = @get_headers($link);
  597. if (!preg_match("|200|", $AgetHeaders[0])) {
  598. $link = $link1."&amp;format=mp4-360p";
  599. $AgetHeaders = @get_headers($link);
  600. if (!preg_match("|200|", $AgetHeaders[0])) {
  601. $link = $link1."&amp;format=flv-vp6";
  602. $AgetHeaders = @get_headers($link);
  603. if (!preg_match("|200|", $AgetHeaders[0])) {
  604. $link="";
  605. }
  606. }
  607. }
  608. } elseif (strpos($filelink, 'filmedocumentare.com') !==false) {
  609. $h = file_get_contents($filelink);
  610. $link=trim(str_between($h,"<location>","</location>"));
  611. } elseif (strpos($filelink, 'xvidstage.com') !== false) {
  612. //http://xvidstage.com/zwvh3et6vugo
  613. //http://xvidstage.com/embed-26kpbe5apbem.html
  614. if (strpos($filelink,"embed") !== false) {
  615. $h = file_get_contents($filelink);
  616. } else {
  617. $id = substr(strrchr($filelink, "/"), 1);
  618. $filelink = "http://xvidstage.com/embed-".$id.".html";
  619. $h = file_get_contents($filelink);
  620. }
  621. $link=unpack_DivXBrowserPlugin(2,$h);
  622. } elseif (strpos($filelink, 'viki.com') !==false) {
  623. preg_match('/(viki\.com\/player\/medias\/)([\w\-]+)/', $filelink, $match);
  624. $viki_id = $match[2];
  625. $l1="http://www.viki.com/player/medias/".$viki_id."/info.json?rtmp=true&source=embed&embedding_uri=www.viki.com";
  626. $h=file_get_contents($l1);
  627. if (strpos($h,"rtmp") === false) {
  628. $new_file="D://dolce.gz";
  629. $new_file="/tmp/dolce.gz";
  630. $fh = fopen($new_file, 'w');
  631. fwrite($fh, $html);
  632. fclose($fh);
  633. $zd = gzopen($new_file, "r");
  634. $h = gzread($zd, filesize($new_file));
  635. gzclose($zd);
  636. }
  637. $rtmp=str_between($h,'"uri":"','"');
  638. //rtmp://fms.354a.edgecastcdn.net/00354A/videos/encoded/Heartstrings/mp4:131448_Heartstrings_001_480p.mp4"
  639. $t1=explode("/",$rtmp);
  640. $y=$t1[7];
  641. $a=$t1[3]."/".$t1[4]."/".$t1[5]."/".$t1[6];
  642. $rtmp=$t1[0]."//".$t1[2]."/".$a;
  643. $link = "http://127.0.0.1/cgi-bin/scripts/util/translate1.cgi?stream,Rtmp-options:-a%20".$a."%20-y%20".$y."%20-W%20http://a3.vikiassets.com/swfs/vikiplayer.swf%20-p%20http://www.viki.com,".$rtmp;
  644. } elseif (strpos($filelink, 'modovideo.com') !==false) {
  645. //http://www.modovideo.com/video.php?v=fx8jyb4o9g9yhl37xqnm7idchw67q7zb
  646. //http://www.modovideo.com/frame.php?v=fx8jyb4o9g9yhl37xqnm7idchw67q7zb
  647. //http://www.modovideo.com/video?v=xa8xysu73n6h2djewvhwsox2e736y0cb
  648. $t=explode("v=",$filelink);
  649. $id=$t[1];
  650. $filelink = "http://www.modovideo.com/frame.php?v=".$id;
  651. $h = file_get_contents($filelink);
  652. $link = str_between($h,"plugin.video=","&");
  653. } elseif (strpos($filelink, 'roshare.info') !==false) {
  654. $h=file_get_contents($filelink);
  655. $link=unpack_DivXBrowserPlugin(2,$h);
  656. } elseif (strpos($filelink, 'filebox.com') !==false) {
  657. //http://www.filebox.com/embed-mxw6nxj1blfs-970x543.html
  658. //http://www.filebox.com/mxw6nxj1blfs
  659. if (strpos($filelink,"embed") === false) {
  660. $id=substr(strrchr($filelink,"/"),1);
  661. $filelink="http://www.filebox.com/embed-".$id."-970x543.html";
  662. }
  663. $h=file_get_contents($filelink);
  664. $link=str_between($h,"{url: '","'");
  665. } elseif (strpos($filelink, 'zixshare.com') !==false) {
  666. //http://www.zixshare.com/files/Olsjbm1k1331045051.html
  667. $h=file_get_contents($filelink);
  668. $l=str_between($h,"goNewWin('","'");
  669. $h=file_get_contents($l);
  670. $t1=explode("clip: {",$h);
  671. $link=urldecode(str_between($t1[1],"url: '","'"));
  672. } elseif (strpos($filelink,"glumbouploads.com") !== false) {
  673. $h=file_get_contents($filelink);
  674. $id=str_between($h,'"id" value="','"');
  675. $fname=str_between($h,'"fname" value="','"');
  676. $referer=str_between($h,'"referer" value="','"');
  677. $post="op=download1&usr_login=&id=".$id."&fname".$fname."&referer=".urlencode($referer)."&method_free=Slow+Download";
  678. $ch = curl_init();
  679. curl_setopt($ch, CURLOPT_URL, $filelink);
  680. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  681. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
  682. //curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; U; Android 0.5; en-us) AppleWebKit/522+ (KHTML, like Gecko) Safari/419.3');
  683. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  684. curl_setopt ($ch, CURLOPT_POST, 1);
  685. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  686. $h = curl_exec($ch);
  687. curl_close($ch);
  688. $link=unpack_DivXBrowserPlugin(2,$h);
  689. } elseif (strpos($filelink, 'uploadc.com') !== false) {
  690. //http://www.uploadc.com/a2baprw26l3m/np-prophezeiung-xvid.avi.htm
  691. //http://www.uploadc.com/3yr7ppb79797/Rush.Hour.3.2007i.flv.htm
  692. //http://www.uploadc.com/embed-3yr7ppb79797.html
  693. if (strpos($filelink,".flv") !== false) {
  694. $t1=explode("/",$filelink);
  695. $id=$t1[3];
  696. $filelink="http://www.uploadc.com/embed-".$id.".html";
  697. $h=file_get_contents($filelink);
  698. $link=str_between($h,"addVariable('file','","'");
  699. } else {
  700. $link=uploadc($filelink);
  701. }
  702. } elseif (strpos($filelink, 'sharefiles4u.com') !== false) {
  703. //http://www.sharefiles4u.com/cwfqw29ylesp/nrx-ausgewechselt.avi
  704. //http://stage666.net/cgi-bin/dl.cgi/kylgrtsmovb2rbldug23w3o45jkdpr23gv4cxbsdjq/video.avi
  705. $string = $filelink;
  706. $ch = curl_init($string);
  707. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  708. curl_setopt($ch, CURLOPT_REFERER, $string);
  709. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  710. $h = curl_exec($ch);
  711. $id=str_between($h,'"id" value="','"');
  712. $fname=str_between($h,'"fname" value="','"');
  713. $reff=str_between($h,'referer" value="','"');
  714. //op=download1&usr_login=&id=qbk4ipxvxfir&fname=mortal-legende.schlange.avi&referer=http%3A%2F%2Fwww.movie2k.to%2FDie-Legende-der-weissen-Schlange-online-film-1236209.html&method_free=Free+Download
  715. $post="op=download1&usr_login=&id=".$id."&fname=".$fname."&referer=".urlencode($reff)."&method_free=Free+Download";
  716. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  717. curl_setopt($ch, CURLOPT_REFERER, $string);
  718. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  719. curl_setopt ($ch, CURLOPT_POST, 1);
  720. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  721. $h = curl_exec($ch);
  722. $link=unpack_DivXBrowserPlugin(2,$h);
  723. } elseif (strpos($filelink,"uploadboost.com") !==false) {
  724. //op=download1&usr_login=&id=u9bzgynmlbyb&fname=John.Carter.2012.CAM.XviD.HUN-BEOWULF.flv&referer=http%3A%2F%2Fwww.moovie.cc%2Fonline-filmek%2Fjohn-carte-online-2012&method_free=Free+Download
  725. //http://www.uploadboost.com/u9bzgynmlbyb/John.Carter.2012.CAM.XviD.HUN-BEOWULF.flv
  726. $string = $filelink;
  727. $ch = curl_init($string);
  728. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  729. curl_setopt($ch, CURLOPT_REFERER, $string);
  730. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  731. $h = curl_exec($ch);
  732. $id=str_between($h,'"id" value="','"');
  733. $fname=str_between($h,'"fname" value="','"');
  734. $reff=str_between($h,'referer" value="','"');
  735. $post="op=download1&usr_login=&id=".$id."&fname=".$fname."&referer=".urlencode($reff)."&method_free=Free+Download";
  736. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  737. curl_setopt($ch, CURLOPT_REFERER, $string);
  738. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  739. curl_setopt ($ch, CURLOPT_POST, 1);
  740. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  741. $h = curl_exec($ch);
  742. $link=unpack_DivXBrowserPlugin(1,$h);
  743. } elseif (strpos($filelink,'nowvideo.eu') !==false) {
  744. //http://www.nowvideo.eu/video/t88lo38nphkhu
  745. //http://embed.nowvideo.eu/embed.php?v=t88lo38nphkhu
  746. $h = file_get_contents($filelink);
  747. $f = str_between($h,'flashvars.file="','"');
  748. $k = str_between($h,'flashvars.filekey="','"');
  749. $l="http://www.nowvideo.eu/api/player.api.php?key=".urlencode($k)."&codes=1&pass=undefined&file=".$f."&user=undefined";
  750. //$l=str_replace("&","&amp;",$l);
  751. $h=file_get_contents($l);
  752. $link=str_between($h,"url=","&");
  753. } elseif (strpos($filelink,"vreer.com") !==false) {
  754. //http://vreer.com/q1kqxyhutswf
  755. //op=download1&usr_login=&id=q1kqxyhutswf&fname=_Dark.Tide.2012.HDRiP.AC3-5.1.XviD-SiC.avi&referer=http%3A%2F%2Fwww.movie2k.to%2FDark-Tide-watch-movie-1235718.html&hash=iqjrsjrwkl5ie4h2w35cp7znbuemna3r&method_free=Free+Download
  756. if (strpos($filelink,"embed") !==false) {
  757. $id=str_between($filelink,"embed-","-");
  758. $filelink= "http://vreer.com/".$id;
  759. }
  760. $string = $filelink;
  761. $ch = curl_init($string);
  762. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  763. curl_setopt($ch, CURLOPT_REFERER, $string);
  764. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  765. $h = curl_exec($ch);
  766. $id=str_between($h,'"id" value="','"');
  767. $fname=str_between($h,'"fname" value="','"');
  768. $reff=str_between($h,'referer" value="','"');
  769. $hash=str_between($h,'hash" value="','"');
  770. $post="op=download1&usr_login=&id=".$id."&fname=".$fname."&referer=".urlencode($reff)."&hash=".$hash."&method_free=Free+Download";
  771. sleep(10);
  772. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  773. curl_setopt($ch, CURLOPT_REFERER, $string);
  774. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  775. curl_setopt ($ch, CURLOPT_POST, 1);
  776. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  777. $h = curl_exec($ch);
  778. $link=str_between($h,'file: "','"');
  779. }
  780. //////////////////////////////////////////////////////////////////
  781. if (strpos($filelink, 'seriale.filmesubtitrate.info') !==false) {
  782. $h=file_get_contents($filelink);
  783. if (strpos($filelink,'plmfilmesub') ===false) {
  784. $srt=str_between($h,'captions.file=','&');
  785. $srt = str_replace(" ","%20",$srt);
  786. $filelink=str_between($h,"proxy.link=",'"');
  787. } else {
  788. //http://roshare.info/embed-6cm2e35qoj42-600x390.html"
  789. $t1=explode("roshare",$h);
  790. $t2=explode('"',$t1[1]);
  791. $l="http://roshare".$t2[0];
  792. $h=file_get_contents($l);
  793. $ret1=unpack_DivXBrowserPlugin(2,$h,true);
  794. $ll=explode(",",$ret1);
  795. $link=$ll[0];
  796. $srt=$ll[1]; // cred....
  797. }
  798. //peteava
  799. //http://www.peteava.ro/id-503993
  800. if (strpos($filelink, 'peteava.ro/embed') !== false) {
  801. preg_match('/(video\/)([A-Za-z0-9_]+)/', $filelink, $m);
  802. $id=$m[2];
  803. $filelink = "http://www.peteava.ro/embed/video/".$id;
  804. $h = file_get_contents($filelink);
  805. $id = str_between($h,"hd_file=","&");
  806. if ($id == "") {
  807. $id = str_between($h,"stream.php&file=","&");
  808. }
  809. if ($id <> $last_peteava) {
  810. $last_peteava=$id;
  811. $token = peteava($id);
  812. $link = "http://content.peteava.ro/video/".$id."?start=0&token=".$token;
  813. }
  814. } elseif (strpos($filelink, 'peteava.ro/id') !== false) {
  815. $h = file_get_contents($filelink);
  816. $id = str_between($h,"hd_file=","&");
  817. if ($id == "") {
  818. $id = str_between($h,"stream.php&file=","&");
  819. }
  820. if ($id <> $last_peteava) {
  821. $last_peteava=$id;
  822. $token = peteava($id);
  823. $link = "http://content.peteava.ro/video/".$id."?start=0&token=".$token;
  824. }
  825. } elseif (strpos($filelink, 'content.peteava.ro') !== false) {
  826. $id = str_between($h,"hd_file=","&");
  827. if ($id == "") {
  828. $id = str_between($filelink,"stream.php&file=","&");
  829. }
  830. $p=strpos($id,"."); //cinemaxx.ro
  831. $id1= substr($id,0, $p);
  832. $id2=substr($id,$p,4);
  833. $id= $id1.$id2;
  834. if ($id <> $last_peteava) {
  835. $last_peteava=$id;
  836. $token = peteava($id);
  837. $link = "http://content.peteava.ro/video/".$id."?start=0&token=".$token;
  838. }
  839. } elseif ((strpos($filelink,"vidxden") !==false) || (strpos($filelink,"divxden") !==false)) {
  840. if (strpos($filelink,"embed") === false) {
  841. $t=explode("/",$filelink);
  842. $id= $t[3];
  843. $filelink=$t[0]."/".$t[1]."/".$t[2]."/"."embed-".$id."-width-653-height-362.html";
  844. }
  845. $h = file_get_contents($filelink);
  846. $link=unpack_DivXBrowserPlugin(1,$h);
  847. } elseif (strpos($filelink,"vidbux") !==false) {
  848. //http://www.vidbux.com/lr0puk6p5xb8
  849. if (strpos($filelink,"embed") === false) {
  850. $t=explode("/",$filelink);
  851. $id= $t[3];
  852. $filelink=$t[0]."/".$t[1]."/".$t[2]."/"."embed-".$id."-width-653-height-362.html";
  853. }
  854. $h = file_get_contents($filelink);
  855. $link=unpack_DivXBrowserPlugin(1,$h);
  856. } elseif (strpos($filelink,'videoweed') !==false) {
  857. if (strpos($filelink,"embed") !== false) {
  858. preg_match('/(v=)([A-Za-z0-9_]+)/', $filelink, $m);
  859. $id=$m[2];
  860. $s=explode("/",$filelink);
  861. $filelink="http://".$s[2]."/embed.php?v=".$id."&amp;width=900&amp;height=600";
  862. }
  863. $h = file_get_contents($filelink);
  864. $f = str_between($h,'flashvars.file="','"');
  865. $k = str_between($h,'flashvars.filekey="','"');
  866. $l="http://www.videoweed.es/api/player.api.php?user=undefined&codes=undefined&pass=undefined&file=".$f."&key=".$k;
  867. //$l=str_replace("&","&amp;",$l);
  868. $h=file_get_contents($l);
  869. $link=str_between($h,"url=","&");
  870. } elseif (strpos($filelink,'novamov') !==false) {
  871. if (strpos($filelink,"embed") !== false) {
  872. preg_match('/(v=)([A-Za-z0-9_]+)/', $filelink, $m);
  873. $id=$m[2];
  874. $s=explode("/",$filelink);
  875. //http://embed.novamov.com/embed.php?width=728&height=400&v=yi18gc4a62gsu&px=1
  876. $filelink="http://".$s[2]."/embed.php?v=".$id."&amp;width=600&amp;height=480";
  877. }
  878. $h=file_get_contents($filelink);
  879. $file=str_between($h,'flashvars.file="','"');
  880. $filekey=str_between($h,'flashvars.filekey="','"');
  881. $l="http://www.novamov.com/api/player.api.php?user=undefined&file=".$file."&pass=undefined&key=".urlencode($filekey);
  882. $h=file_get_contents($l);
  883. $link=str_between($h,"url=","&");
  884. }
  885. exec ("rm -f /tmp/test.xml");
  886. if ($srt <> "") {
  887. $file = $srt;
  888. $file=urldecode($file);
  889. $ttxml = '';
  890. $full_line = '';
  891. $last_end=0;
  892. if($file_array = file($file))
  893. {
  894. foreach($file_array as $line)
  895. {
  896. $line = rtrim($line);
  897. $line = preg_replace("/(<\/?)(\w+)([^>]*>)/e","",$line);
  898. if(preg_match('/(\d\d):(\d\d):(\d\d),(\d\d\d) --> (\d\d):(\d\d):(\d\d),(\d\d\d)/', $line, $match))
  899. {
  900. $begin = round(3600 * $match[1] + 60 * $match[2] + $match[3] + $match[4]/1000);
  901. $end = round(3600 *$match[5] + 60 * $match[6] + $match[7] + $match[8]/1000);
  902. //$begin = 3600 * $match[1] + 60 * $match[2] + $match[3] + round($match[4]/100)/10;
  903. //$end = 3600 * $match[5] + 60 * $match[6] + $match[7] + round($match[8]/100)/10;
  904. $line1 = '';
  905. $line2 = '';
  906. $f = "/usr/local/bin/home_menu22";
  907. if (!file_exists($f)) {
  908. if ($begin > $last_end)
  909. {
  910. $ttxml .=$last_end."\n";
  911. $ttxml .=$begin."\n";
  912. $ttxml .="\n";
  913. $ttxml .="\n";
  914. }
  915. $last_end=$end;
  916. }
  917. }
  918. // if the next line is not blank, get the text
  919. elseif($line != '')
  920. {
  921. if($line1 != '')
  922. {
  923. $line2= $line;
  924. }
  925. else
  926. {
  927. $line1= $line;
  928. }
  929. }
  930. // if the next line is blank, write
  931. if($line == '')
  932. {
  933. if ($line2=="") {
  934. $ttxml .=$begin."\n";
  935. $ttxml .=$end."\n";
  936. $ttxml .=$line2."\n";
  937. $ttxml .=$line1."\n";
  938. } else {
  939. $ttxml .=$begin."\n";
  940. $ttxml .=$end."\n";
  941. $ttxml .=$line1."\n";
  942. $ttxml .=$line2."\n";
  943. }
  944. $line1 = '';
  945. $line2 = '';
  946. }
  947. }
  948. //dummy sub
  949. if ($end > 0) {
  950. if (!file_exists($f))
  951. $ttxml .=$end."\n";
  952. else
  953. $ttxml .="10000"."\n";
  954. $ttxml .="10002"."\n";
  955. $ttxml .="\n";
  956. $ttxml .="\n";
  957. }
  958. $new_file = "/tmp/test.xml";
  959. $fh = fopen($new_file, 'w');
  960. fwrite($fh, $ttxml);
  961. fclose($fh);
  962. }
  963. }
  964. } // end seriale.filmesubtitrate.info
  965. print $link;
  966. ?>