PageRenderTime 45ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/scripts/feeds/scripts_vb6/scripts/filme/php/filme_link.php

http://eboda-hd-for-all-500.googlecode.com/
PHP | 456 lines | 447 code | 1 blank | 8 comment | 46 complexity | 31edb6b3ebd3deb4aef33cafcd7277cd MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0
  1. #!/usr/local/bin/Resource/www/cgi-bin/php
  2. <?php
  3. error_reporting(0);
  4. $filelink=$_ENV["QUERY_STRING"];
  5. $t1=explode(",",$filelink);
  6. $filelink = urldecode($t1[0]);
  7. $filelink = str_replace("*",",",$filelink);
  8. $filelink = str_replace("@","&",$filelink); //seriale.subtitrate.info
  9. $pg = urldecode($t1[1]);
  10. if ($pg == "") {
  11. $pg_title = "Link";
  12. } else {
  13. $pg_title = $pg;
  14. $pg = preg_replace('/[^A-Za-z0-9_]/','_',$pg);
  15. }
  16. $titledownload=$pg;
  17. $onlinemoca=$t1[2];
  18. //play movie
  19. if (file_exists("/tmp/usbmounts/sda1/download")) {
  20. $dir = "/tmp/usbmounts/sda1/download/";
  21. $dir_log = "/tmp/usbmounts/sda1/download/log/";
  22. } elseif (file_exists("/tmp/usbmounts/sdb1/download")) {
  23. $dir = "/tmp/usbmounts/sdb1/download/";
  24. $dir_log = "/tmp/usbmounts/sdb1/download/log/";
  25. } elseif (file_exists("/tmp/usbmounts/sdc1/download")) {
  26. $dir = "/tmp/usbmounts/sdc1/download/";
  27. $dir_log = "/tmp/usbmounts/sdc1/download/log/";
  28. } elseif (file_exists("/tmp/usbmounts/sda2/download")) {
  29. $dir = "/tmp/usbmounts/sda2/download/";
  30. $dir_log = "/tmp/usbmounts/sda2/download/log/";
  31. } elseif (file_exists("/tmp/usbmounts/sdb2/download")) {
  32. $dir = "/tmp/usbmounts/sdb2/download/";
  33. $dir_log = "/tmp/usbmounts/sdb2/download/log/";
  34. } elseif (file_exists("/tmp/usbmounts/sdc2/download")) {
  35. $dir = "/tmp/usbmounts/sdc2/download/";
  36. $dir = "/tmp/usbmounts/sdc2/download/log/";
  37. } elseif (file_exists("/tmp/hdd/volumes/HDD1/download")) {
  38. $dir = "/tmp/hdd/volumes/HDD1/download/";
  39. $dir_log = "/tmp/hdd/root/log/";
  40. } else {
  41. $dir = "";
  42. $dir_log = "";
  43. }
  44. // end
  45. ?>
  46. <?php echo "<?xml version='1.0' ?>"; ?>
  47. <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  48. <onEnter>
  49. storagePath = getStoragePath("tmp");
  50. storagePath_stream = storagePath + "stream.dat";
  51. storagePath_playlist = storagePath + "playlist.dat";
  52. setRefreshTime(1);
  53. first_time=1;
  54. </onEnter>
  55. <onExit>
  56. setRefreshTime(-1);
  57. </onExit>
  58. <onRefresh>
  59. if(first_time == 1)
  60. {
  61. setRefreshTime(-1);
  62. itemCount = getPageInfo("itemCount");
  63. first_time=0;
  64. }
  65. else if (do_down == 1)
  66. {
  67. topUrl = "http://127.0.0.1/cgi-bin/scripts/util/info_down.php?file=" + log_file + ",f";
  68. info_serial = getUrl(topUrl);
  69. }
  70. </onRefresh>
  71. <mediaDisplay name="threePartsView"
  72. itemBackgroundColor="0:0:0"
  73. backgroundColor="0:0:0"
  74. sideLeftWidthPC="0"
  75. sideRightWidthPC="0"
  76. sideColorRight="0:0:0"
  77. itemImageXPC="5"
  78. itemXPC="20"
  79. itemYPC="20"
  80. itemWidthPC="70"
  81. capWidthPC="70"
  82. unFocusFontColor="101:101:101"
  83. focusFontColor="255:255:255"
  84. showHeader="no"
  85. showDefaultInfo="yes"
  86. bottomYPC="90"
  87. infoYPC="100"
  88. infoXPC="0"
  89. popupXPC = "40"
  90. popupYPC = "55"
  91. popupWidthPC = "22.3"
  92. popupHeightPC = "5.5"
  93. popupFontSize = "13"
  94. popupBorderColor="28:35:51"
  95. popupForegroundColor="255:255:255"
  96. popupBackgroundColor="28:35:51"
  97. idleImageXPC="5" idleImageYPC="5" idleImageWidthPC="8" idleImageHeightPC="10"
  98. >
  99. <idleImage>image/POPUP_LOADING_01.png</idleImage>
  100. <idleImage>image/POPUP_LOADING_02.png</idleImage>
  101. <idleImage>image/POPUP_LOADING_03.png</idleImage>
  102. <idleImage>image/POPUP_LOADING_04.png</idleImage>
  103. <idleImage>image/POPUP_LOADING_05.png</idleImage>
  104. <idleImage>image/POPUP_LOADING_06.png</idleImage>
  105. <idleImage>image/POPUP_LOADING_07.png</idleImage>
  106. <idleImage>image/POPUP_LOADING_08.png</idleImage>
  107. <text align="center" offsetXPC="0" offsetYPC="0" widthPC="100" heightPC="18" fontSize="24" backgroundColor="10:105:150" foregroundColor="100:200:255">
  108. <script>getPageInfo("pageTitle");</script>
  109. </text>
  110. <text align="left" offsetXPC="6" offsetYPC="15" widthPC="100" heightPC="4" fontSize="16" backgroundColor="10:105:150" foregroundColor="100:200:255">
  111. Apasati 1 pentru download manager, 2 pentru download, 3 pentru vizionare download, 4 verificare link
  112. </text>
  113. <text redraw="yes" align="center" offsetXPC="0" offsetYPC="90" widthPC="100" heightPC="8" fontSize="17" backgroundColor="10:105:150" foregroundColor="100:200:255">
  114. <script>print(info_serial); info_serial;</script>
  115. </text>
  116. <onUserInput>
  117. userInput = currentUserInput();
  118. ret = "false";
  119. if(userInput == "two" || userInput == "2")
  120. {
  121. tip=getItemInfo(getFocusItemIndex(),"tip");
  122. showIdle();
  123. if (tip == "1")
  124. {
  125. url = getItemInfo(getFocusItemIndex(),"download");
  126. movie=getUrl(url);
  127. info_serial="link:" + movie;
  128. topUrl = "http://127.0.0.1/cgi-bin/scripts/util/download.cgi?link=" + movie + ";name=" + getItemInfo(getFocusItemIndex(),"name");
  129. }
  130. else if (tip == "2")
  131. {
  132. topUrl = "http://127.0.0.1/cgi-bin/scripts/util/download.cgi?link=" + getItemInfo(getFocusItemIndex(),"download") + ";name=" + getItemInfo(getFocusItemIndex(),"name");
  133. }
  134. dummy = getUrl(topUrl);
  135. cancelIdle();
  136. do_down=1;
  137. file_name= getItemInfo(getFocusItemIndex(),"title");
  138. log_file="<?php echo $dir_log; ?>" + getItemInfo(getFocusItemIndex(),"name") + ".log";
  139. setRefreshTime(10000);
  140. ret="true";
  141. }
  142. else if (userInput == "three" || userInput == "3")
  143. {
  144. url="<?php echo $dir; ?>" + getItemInfo(getFocusItemIndex(),"name");
  145. playItemurl(url,10);
  146. ret="true";
  147. }
  148. else if(userInput == "four" || userInput == "4")
  149. {
  150. showIdle();
  151. url = getItemInfo(getFocusItemIndex(),"download");
  152. info_serial="link:" + url;
  153. redrawdisplay();
  154. tip=getItemInfo(getFocusItemIndex(),"tip");
  155. if (tip == "1")
  156. {
  157. movie=getUrl(url);
  158. info_serial="movie:" + movie;
  159. }
  160. cancelIdle();
  161. redrawdisplay();
  162. ret="true";
  163. }
  164. else if (userInput == "one" || userInput == "1")
  165. {
  166. jumpToLink("destination");
  167. ret="true";
  168. }
  169. else
  170. {
  171. info_serial=" ";
  172. setRefreshTime(-1);
  173. do_down=0;
  174. ret="false";
  175. }
  176. ret;
  177. </onUserInput>
  178. </mediaDisplay>
  179. <destination>
  180. <link>http://127.0.0.1/cgi-bin/scripts/util/level.php
  181. </link>
  182. </destination>
  183. <channel>
  184. <?php
  185. echo "<title>".$pg_title."</title>"
  186. ;
  187. function str_between($string, $start, $end){
  188. $string = " ".$string; $ini = strpos($string,$start);
  189. if ($ini == 0) return ""; $ini += strlen($start); $len = strpos($string,$end,$ini) - $ini;
  190. return substr($string,$ini,$len);
  191. }
  192. /**####################################**/
  193. /** Here we start.......**/
  194. $last_link = "";
  195. if (strpos($filelink,"onlinemoca") === false) {
  196. if (strpos($filelink,"filmeonlinesubtitrate.ro") !== false) {
  197. $post="pageviewnr=1";
  198. $ch = curl_init($filelink);
  199. curl_setopt ($ch, CURLOPT_POST, 1);
  200. curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
  201. curl_setopt($ch, CURLOPT_FOLLOWLOCATION ,1);
  202. curl_setopt($ch, CURLOPT_RETURNTRANSFER ,1); // RETURN THE CONTENTS OF THE CALL
  203. $html = curl_exec($ch);
  204. curl_close ($ch);
  205. } else {
  206. $html = file_get_contents($filelink);
  207. }
  208. } else {
  209. $html="";
  210. }
  211. /**####################################onlinemoca###############**/
  212. //Prea multe link-uri, trimit doar un link!
  213. if (strpos($filelink, 'onlinemoca') !== false) {
  214. $filelink=$onlinemoca;
  215. if (strpos($filelink,"adf.ly") !==false) {
  216. $h1=file_get_contents($filelink);
  217. $filelink=str_between($h1,"var url = '","'");
  218. } else {
  219. $t1=explode("link=",$filelink);
  220. $filelink=$t1[1];
  221. }
  222. $server = str_between($filelink,"http://","/");
  223. $title = $server;
  224. $link="http://127.0.0.1/cgi-bin/scripts/filme/php/link.php?file=".urlencode($filelink);
  225. $server = str_between($filelink,"http://","/");
  226. $title=$server. " - With seek - SDK4";
  227. echo'
  228. <item>
  229. <title>'.$title.'</title>
  230. <onClick>
  231. <script>
  232. showIdle();
  233. movie="'.$link.'";
  234. url=getUrl(movie);
  235. cancelIdle();
  236. streamArray = null;
  237. streamArray = pushBackStringArray(streamArray, "");
  238. streamArray = pushBackStringArray(streamArray, "");
  239. streamArray = pushBackStringArray(streamArray, url);
  240. streamArray = pushBackStringArray(streamArray, url);
  241. streamArray = pushBackStringArray(streamArray, video/x-flv);
  242. streamArray = pushBackStringArray(streamArray, "'.$pg_title.'");
  243. streamArray = pushBackStringArray(streamArray, "1");
  244. writeStringToFile(storagePath_stream, streamArray);
  245. doModalRss("rss_file:///usr/local/etc/www/cgi-bin/scripts/util/videoRenderer.rss");
  246. </script>
  247. </onClick>
  248. <download>'.$link.'</download>
  249. <tip>1</tip>
  250. <name>'.$titledownload.'.flv</name>
  251. </item>
  252. ';
  253. }
  254. /**################ All links ################**/
  255. if(preg_match_all("/(http\b.*?)(\"|\')+/i",$html,$matches)) {
  256. $links=$matches[1];
  257. }
  258. $s="/adf.ly|vidxden\.c|divxden\.c|vidbux\.c|movreel\.c|videoweed\.(c|e)|novamov\.(c|e)|vk\.com";
  259. $s=$s."|movshare\.net|videobb\.c|youtube\.c|flvz\.com|rapidmov\.net|putlocker\.com|";
  260. $s=$s."videozer\.com|peteava\.ro\/embed|peteava\.ro\/id|content\.peteava\.ro";
  261. $s=$s."|vimeo\.com|googleplayer\.swf|filebox\.ro\/get_video|vkontakte\.ru|megavideo\.com";
  262. $s=$s."/i";
  263. for ($i=0;$i<count($links);$i++) {
  264. $cur_link=$links[$i];
  265. if (preg_match($s,$cur_link)) {
  266. if ($cur_link <> $last_link) {
  267. if (!preg_match("/facebook|twitter|img\.youtube/",$cur_link)) {
  268. $link="http://127.0.0.1/cgi-bin/scripts/filme/php/link.php?file=".urlencode($cur_link);
  269. $server = str_between($cur_link,"http://","/");
  270. $last_link=$cur_link;
  271. $title=$server. " - With seek - SDK4";
  272. echo'
  273. <item>
  274. <title>'.$title.'</title>
  275. <onClick>
  276. <script>
  277. showIdle();
  278. movie="'.$link.'";
  279. url=getUrl(movie);
  280. cancelIdle();
  281. streamArray = null;
  282. streamArray = pushBackStringArray(streamArray, "");
  283. streamArray = pushBackStringArray(streamArray, "");
  284. streamArray = pushBackStringArray(streamArray, url);
  285. streamArray = pushBackStringArray(streamArray, url);
  286. streamArray = pushBackStringArray(streamArray, video/x-flv);
  287. streamArray = pushBackStringArray(streamArray, "'.$pg_title.'");
  288. streamArray = pushBackStringArray(streamArray, "1");
  289. writeStringToFile(storagePath_stream, streamArray);
  290. doModalRss("rss_file:///usr/local/etc/www/cgi-bin/scripts/util/videoRenderer.rss");
  291. </script>
  292. </onClick>
  293. <download>'.$link.'</download>
  294. <tip>1</tip>
  295. <name>'.$titledownload.'.flv</name>
  296. </item>
  297. ';
  298. }
  299. }
  300. }
  301. }
  302. /**################ special links ##############**/
  303. if (preg_match_all('/<(iframe\b|object\b)[^>]+src\s?=\s?([\'|\"])(.*?)(\"|\')+/is', $html, $matches)) {
  304. $links=$matches[3];
  305. }
  306. $link="";
  307. $srt="";
  308. for ($i=0;$i<count($links);$i++) {
  309. $cur_link=$links[$i];
  310. if (strpos($cur_link,"rofilm.info") !==false) {
  311. $baza = file_get_contents($cur_link);
  312. $t1=explode('value="file=',$baza);
  313. $t2=explode("&",$t1[1]);
  314. $link = $t2[0];
  315. if ($link=="") {
  316. $t1=explode("value='file=",$baza);
  317. $t2=explode("&",$t1[1]);
  318. $link=$t2[0];
  319. }
  320. $t1=explode('captions.file=',$baza);
  321. $t2=explode("&",$t1[1]);
  322. $srt=$t2[0];
  323. $srt = str_replace(" ","%20",$srt);
  324. } elseif (strpos($cur_link,"serialetvonline.info") !==false) {
  325. if (strpos($cur_link,"gettvguide2.php") === false) {
  326. $baza = file_get_contents($cur_link);
  327. $link = str_between($baza,'"flashvars" value="file=','&');
  328. $t1=explode('captions.file=',$baza);
  329. $t2=explode("&",$t1[1]);
  330. $srt=$t2[0];
  331. $srt = str_replace(" ","%20",$srt);
  332. }
  333. } elseif (strpos($cur_link,"rosharing.com") !==false) {
  334. $baza = file_get_contents($cur_link);
  335. $link = str_between($baza,'value="file=','&');
  336. $t1=explode('captions.file=',$baza);
  337. $t2=explode("&",$t1[1]);
  338. $srt=$t2[0];
  339. $srt = str_replace(" ","%20",$srt);
  340. } else {
  341. $link="";
  342. $srt="";
  343. }
  344. if ($link <> $last_link) {
  345. if ($link <> "") {
  346. $server = str_between($link,"http://","/");
  347. $title=$server. " - With seek - SDK4";
  348. echo'
  349. <item>
  350. <title>'.$title.'</title>
  351. <onClick>
  352. <script>
  353. showIdle();
  354. url="'.$link.'";
  355. cancelIdle();
  356. streamArray = null;
  357. streamArray = pushBackStringArray(streamArray, "");
  358. streamArray = pushBackStringArray(streamArray, "");
  359. streamArray = pushBackStringArray(streamArray, url);
  360. streamArray = pushBackStringArray(streamArray, url);
  361. streamArray = pushBackStringArray(streamArray, video/x-flv);
  362. streamArray = pushBackStringArray(streamArray, "'.$pg_title.'");
  363. streamArray = pushBackStringArray(streamArray, "1");
  364. writeStringToFile(storagePath_stream, streamArray);
  365. doModalRss("rss_file:///usr/local/etc/www/cgi-bin/scripts/util/videoRenderer.rss");
  366. </script>
  367. </onClick>
  368. <download>'.$link.'</download>
  369. <tip>2</tip>
  370. <name>'.$titledownload.'.flv</name>
  371. </item>
  372. ';
  373. }
  374. if (($srt <> "") && (strpos($srt,".srt") !==false)) {
  375. echo '
  376. <item>
  377. <title>Subtitrare</title>
  378. <download>'.$srt.'</download>
  379. <tip>2</tip>
  380. <name>'.$titledownload.'.srt</name>
  381. </item>
  382. ';
  383. }
  384. $last_link = $link;
  385. }
  386. }
  387. /**################ flash... mediafile,file.....############**/
  388. $videos = explode('flash', $html);
  389. unset($videos[0]);
  390. $videos = array_values($videos);
  391. foreach($videos as $video) {
  392. $t1 = explode('ile=', $video);
  393. $t2 = explode('&', $t1[1]);
  394. $t3 = explode("'",$t2[0]);
  395. $link = urldecode($t3[0]);
  396. if (($link <> "") && strcmp($link,$lastlink)) {
  397. if (strpos($link, 'http://') !== false){
  398. $titledownload = $pg;
  399. $title=str_between($link,"http://","/");
  400. $ext=".flv";
  401. $lastlink = $link;
  402. // for sdk4.... with seek
  403. $title=$title. " - With seek - SDK4";
  404. echo'
  405. <item>
  406. <title>'.$title.'</title>
  407. <onClick>
  408. <script>
  409. showIdle();
  410. url="'.$link.'";
  411. cancelIdle();
  412. streamArray = null;
  413. streamArray = pushBackStringArray(streamArray, "");
  414. streamArray = pushBackStringArray(streamArray, "");
  415. streamArray = pushBackStringArray(streamArray, url);
  416. streamArray = pushBackStringArray(streamArray, url);
  417. streamArray = pushBackStringArray(streamArray, video/x-flv);
  418. streamArray = pushBackStringArray(streamArray, "'.$pg_title.'");
  419. streamArray = pushBackStringArray(streamArray, "1");
  420. writeStringToFile(storagePath_stream, streamArray);
  421. doModalRss("rss_file:///usr/local/etc/www/cgi-bin/scripts/util/videoRenderer.rss");
  422. </script>
  423. </onClick>
  424. <download>'.$link.'</download>
  425. <tip>2</tip>
  426. <name>'.$titledownload.'.'.$ext.'</name>
  427. </item>
  428. ';
  429. $srt1 = str_between($video,'captions.file=','&');
  430. $t1=explode('"',$srt1);
  431. $srt = $t1[0];
  432. if (strpos($srt,"http") === false) {
  433. ////www.veziserialeonline.info,www.seriale-filme.info
  434. $s1=explode("/",$filelink);
  435. $s=$s1[2];
  436. $srt="http://".$s.$srt;
  437. }
  438. $pct = substr($srt, -4, 1);
  439. if (($srt <> "") && ($pct == ".") && (strpos($srt,".srt") !==false)) {
  440. echo '
  441. <item>
  442. <title>Subtitrare</title>
  443. <download>'.$srt.'</download>
  444. <tip>2</tip>
  445. <name>'.$titledownload.'.srt</name>
  446. </item>
  447. ';
  448. }
  449. }
  450. }
  451. } //foreach
  452. ?>
  453. </channel>
  454. </rss>