function testFFMpeg() { $VideoUtil = new VideoUtil(); $load = $VideoUtil->LoadFile(dirname(__FILE__)."/testvideo/2.mpeg"); $this->assertTrue($load, "Movie file loaded"); $length = $VideoUtil->GetLength(); $this->assertTrue($length > 0, "Length detected"); $VideoUtil->SetDimensions(100, 120); $path = ini_get("session.save_path") ? ini_get("session.save_path") : "/tmp"; $path .="/video_thumbs"; $VideoUtil->SetOutputPath($path); $VideoUtil->Cut(3); $check = file_exists("{$path}/0.jpg"); $check &= file_exists("{$path}/1.jpg"); $check &= file_exists("{$path}/2.jpg"); $this->assertTrue($check, "Thumbnails created"); @unlink("{$path}/0.jpg"); @unlink("{$path}/1.jpg"); @unlink("{$path}/2.jpg"); }
/** * Prints first available episode link. */ function printSerieEspisodeLink($episodeLink) { //Get page content $content = file_get_contents("http://www.cinetube.es" . $episodeLink); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content)); //Get links preg_match_all("/<div class\\=\"tit_opts\"><a(.*)href\\=\"(.*)\"(.*)><p>(.*)<span(.*)span><\\/p><p><span\\>(.*)<\\/span><\\/p>(.*)<\\/div>/siU", $content, $divs, PREG_SET_ORDER); //Get mirrors if ($divs) { foreach ($divs as $value) { $content = file_get_contents("http://www.cinetube.es" . $value[2]); //Add video if (strpos($content, "www.megavideo.com/?v=")) { preg_match_all("|www\\.megavideo\\.com\\/\\?v\\=(.*)\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megavideo_id) { if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); echo $array[1]; return; } } } } } } echo "ERROR"; }
/** * Prints first available movie link. */ function fetchMovie($movieId) { $content = file_get_contents("http://www.watchnewfilms.com/" . $movieId); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content)); //Get film avaible links //Get principal megavideo link if (strpos($content, "http://www.megavideo.com/v")) { preg_match_all("|www.megavideo.com\\/v\\/(.*)\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $value) { //Get megavideo id $megavideo_id = substr($value, 0, -32); if ($megavideo_id) { //If megaupload cookie is defined, use it, in other case, use alternative method if (COOKIE_STATE_ACTIVATED) { //generateMegavideoPremiumLink($tempTitle, $imageUrl, $counter, $megavideo_id); $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { echo $array[1]; return; } } } } } } //Get alternative megavideo links if (strpos($content, "http://www.megavideo.com/?v=")) { preg_match_all("/www.megavideo.com\\/\\?v\\=(.*)\\'/U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megavideo_id) { if ($megavideo_id != null) { //If megaupload cookie is defined, use it, in other case, use alternative method if (COOKIE_STATE_ACTIVATED) { //generateMegavideoPremiumLink($tempTitle, $imageUrl, $counter, $megavideo_id); $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); //echo $megavideo_id; if ($array) { echo $array[1]; return; } } } } } } //Get youtube links if (strpos($content, "http://www.youtube.com/v")) { $link = substr($content, strpos($content, "http://www.youtube.com/v")); $link = substr($link, strpos($link, "v/") + 2); echo VideoUtil::generateYoutubeLink(substr($link, 0, strpos($link, "&"))); return; } }
/** * Generate links with megaupload premium account * * @param String $megavideo_id * @return String Url, false if not found. */ public static function generateMegauploadPremiumLink($megavideo_id) { $link = "http://www.megaupload.com/?d=" . $megavideo_id; $options = array('http' => array('method' => "GET", 'header' => "Accept-language: en\r\n" . "Keep-Alive: 115\r\n" . "Connection: keep-alive\r\n" . "Cookie: l=es; user="******"\r\n")); $context = stream_context_create($options); $content = file_get_contents($link, false, $context); if (!strstr($content, "captchacode")) { $content = strstr($content, "down_ad_pad1"); $content = strstr($content, '<a href="'); $megauploadUrl = substr($content, 9, strpos($content, '" ') - 9); $megauploadUrl = urldecode($megauploadUrl); $megauploadUrl = html_entity_decode($megauploadUrl); $videoType = VideoUtil::getEnclosureMimetype($megauploadUrl); if ($megauploadUrl) { return array(substr($megauploadUrl, strrpos($megauploadUrl, "/") + 1), $megauploadUrl, $videoType); } } }
/** * Prints first available movie link. */ function fetchMovie($movie) { $content = file_get_contents($movie); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8")); //Get megavideo id and link preg_match("/wwwstatic.megavideo.com\\/mv_player.swf(.*)&v=(.*)\"/siU", $content, $links); if ($links && $links[2]) { $megavideo_id = $links[2]; if (COOKIE_STATE_ACTIVATED && $megavideo_id) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { echo $array[1]; return; } } } echo "ERROR"; }
/** * Prints first available movie link. */ function fetchEpisode($season, $episode) { if (isset($_GET["PHPSESID"])) { session_id($_GET["PHPSESID"]); session_start(); $serie = unserialize($_SESSION["serie"]); $link = $serie[$season]; $link = $link[$episode]; $episodeLink = $link[1]; $content = file_get_contents($episodeLink); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $input = str_replace($newlines, "", utf8_decode($content)); preg_match("/<h5>Available Sources<\\/h5>(.*)<\\/div>/U", $input, $div); if ($div && strpos($div[1], "megavideo")) { preg_match_all("/<span>(.*)<\\/span>/siU", $div[1], $div); //Get only megavideos if ($div) { $i = 0; foreach ($div[1] as $value) { if (strpos($value, "megavideo")) { preg_match("/load_source_new\\((.*)\\,/U", $value, $id); $megavideo_id = file_get_contents(substr($episodeLink, 0, strrpos($episodeLink, "/")) . "/play_source.php?id=" . $id[1]); preg_match("/megavideo.com\\/\\?v\\=(.*)\"/U", $megavideo_id, $megavideo_id); if ($megavideo_id) { $megavideo_id = $megavideo_id[1]; if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { echo $array[1]; return; } } } } } } } } echo "ERROR"; }
/** * Show template. */ public function showTemplate() { header("Content-type: text/xml"); echo '<?xml version="1.0" encoding="UTF-8" ?>' . "\n"; echo '<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://purl.org/dc/elements/1.1/">' . "\n"; $this->showHeader(); echo ' <channel>' . "\n"; echo ' <title>' . $this->title . '</title>' . "\n"; $itemid = 0; switch ($this->playlistLink->getType()) { case PlaylistLink::TYPE_MEGAUPLOAD: //------------------------------ foreach ($this->playlistLink->getIds() as $order => $id) { $arrayValue = VideoUtil::generateMegauploadPremiumLink($id); if ($arrayValue) { echo $this->getPlaylistItem($arrayValue[0], $this->playlistLink->getDescription(), $this->playlistLink->getThumbnail(), $arrayValue[1], $arrayValue[2], $itemid); ++$itemid; } } break; case PlaylistLink::TYPE_MEGAVIDEO: //------------------------------- foreach ($this->playlistLink->getIds() as $order => $id) { $arrayValue = VideoUtil::generateMegavideoPremiumLink($id); if ($arrayValue) { echo $this->getPlaylistItem($arrayValue[0], $this->playlistLink->getDescription(), $this->playlistLink->getThumbnail(), $arrayValue[1], $arrayValue[2], $itemid); ++$itemid; } } break; default: //--------------------------------------------------------- break; } echo ' </channel>' . "\n"; echo '</rss>'; }
function fetchEpisode($season, $episode, $episodeName) { $template = new TenstarmoviesTemplate(); if (isset($_GET["PHPSESID"])) { session_id($_GET["PHPSESID"]); session_start(); $serie = unserialize($_SESSION["serie"]); $coverImage = $_SESSION["coverImage"]; $title = $_SESSION["title"]; $link = $serie[$season]; $link = $link[$episode]; $episodeLink = $link[1]; $template->setEpisodeName($episodeName); $template->setCoverImage($coverImage); $template->setTitle($title); $content = file_get_contents($episodeLink); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $input = str_replace($newlines, "", utf8_decode($content)); preg_match("/<script type=\"text\\/javascript\"> function loadinitial(.*)<div id=\"video_loading_stat\">/U", $input, $div); //Get episode description if (strpos($input, "<div id=\"incomplete")) { preg_match("/<div id\\=\"incomplete\" style\\=\"display\\:block\\;\">(.*)</U", $input, $des); } else { preg_match("/<div class\\=\"sum\">(.*)</U", $input, $des); } if ($des) { $template->setDescription($des[1]); } //LOOMBO if ($div && strpos($div[1], "loombo")) { $div2 = $div; preg_match_all("/<span>(.*)<\\/span>/siU", $div2[1], $div2); //Get only loombo if ($div2) { $i2 = 0; foreach ($div2[1] as $value2) { if (strpos($value2, "loombo")) { preg_match("/load_source_new\\((.*)\\,/U", $value2, $id2); $loombo_id = file_get_contents(substr($episodeLink, 0, strrpos($episodeLink, "/")) . "/play_source.php?id=" . $id2[1]); preg_match("/href=\"http:\\/\\/loombo\\.com\\/(.*)\"/U", $loombo_id, $loombo_id); if ($loombo_id) { $content = file_get_contents("http://loombo.com/embed-" . $loombo_id[1] . "-0x0.html"); preg_match("/\\(\\'flashvars\\',\\'file=(.*)\\'\\)\\;/U", $content, $links); if ($links) { $link = $links[1]; $template->addMediaItem("[Loombo " . $i2 . "]", substr($link, strrpos($link, "/") + 1), $link, "", VideoUtil::getEnclosureMimetype($link)); ++$i2; } } } if ($i2 > 1) { break; } } } } //MEGAVIDEO if ($div && strpos($div[1], "megavideo")) { preg_match_all("/<span>(.*)<\\/span>/siU", $div[1], $div); //Get only megavideos if ($div) { $i = 0; foreach ($div[1] as $value) { if (strpos($value, "megavideo")) { preg_match("/load_source_new\\((.*)\\,/U", $value, $id); $megavideo_id = file_get_contents(substr($episodeLink, 0, strrpos($episodeLink, "/")) . "/play_source.php?id=" . $id[1]); preg_match("/megavideo.com\\/\\?v\\=(.*)\"/U", $megavideo_id, $megavideo_id); if ($megavideo_id) { $megavideo_id = $megavideo_id[1]; if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array && $array[2]) { $template->addMediaItem("[Megavideo " . $i . "]", $array[0], $array[1], "" . $megavideo_id, $array[2]); ++$i; } } } } if ($i > 1) { break; } } } } $template->generateView(TenstarmoviesTemplate::VIEW_PLAY, $episodeName); } }
/** * Show link details and check links. */ private function showPlaylistLink() { echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0">' . "\n"; echo ' <tr>' . "\n"; echo ' <td style="vertical-align:top;">' . "\n"; echo ' <img width="134px" height="193px" src="' . $this->playlistLink->getThumbnail() . '" style="border:0px;" />' . "\n"; echo ' <p>' . htmlentities($this->playlistLink->getFormat()) . '</p>' . "\n"; echo ' <p>' . htmlentities($this->playlistLink->getLanguage()) . '</p>' . "\n"; echo ' <p>' . htmlentities($this->playlistLink->getTypeDescription()) . '</p>' . "\n"; echo ' </td>' . "\n"; echo ' <td style="vertical-align:top;">' . "\n"; echo ' <p style="font-weight:bold;">' . htmlentities($this->playlistLink->getTitle()) . '</p>' . "\n"; echo ' <p style="text-align:justify;">' . htmlentities($this->playlistLink->getDescription()) . '</p>' . "\n"; echo ' </td>' . "\n"; echo ' </tr>' . "\n"; $itemid = 1; switch ($this->playlistLink->getType()) { case PlaylistLink::TYPE_MEGAUPLOAD: //------------------------------ foreach ($this->playlistLink->getIds() as $order => $id) { $arrayValue = VideoUtil::generateMegauploadPremiumLink($id); echo ' <tr>' . "\n"; echo ' <td align="top" colspan="2">' . "\n"; if ($arrayValue) { echo ' Link ' . $itemid . ': <a href="' . $arrayValue[1] . '">' . $arrayValue[0] . '</a>. Source: <a target="_blank" href="http://www.megaupload.com/?d=' . $id . '"><img width="22px" height="22px" src="../resources/playlist/view.png" style="border:0px;" /></a>' . "\n"; } else { echo ' Link error: <a href="http://www.megaupload.com/?d=' . $id . '">http://www.megaupload.com/?d=' . $id . '</a>' . "\n"; } echo ' </td>' . "\n"; echo ' </tr>' . "\n"; ++$itemid; } break; case PlaylistLink::TYPE_MEGAVIDEO: //------------------------------- foreach ($this->playlistLink->getIds() as $order => $id) { $arrayValue = VideoUtil::generateMegavideoPremiumLink($id); echo ' <tr>' . "\n"; echo ' <td align="top" colspan="2">' . "\n"; if ($arrayValue) { echo ' Link ' . $itemid . ': <a href="' . $arrayValue[1] . '">' . $arrayValue[0] . '</a>. Source: <a target="_blank" href="http://www.megavideo.com/?v=' . $id . '"><img width="22px" height="22px" src="../resources/playlist/view.png" style="border:0px;" /></a>' . "\n"; } else { echo ' Link error: <a href="http://www.megavideo.com/?v=' . $id . '">http://www.megavideo.com/?v=' . $id . '</a>' . "\n"; } echo ' </td>' . "\n"; echo ' </tr>' . "\n"; ++$itemid; } break; default: //--------------------------------------------------------- break; } echo ' </table>' . "\n"; }
function addGubaComFlash($template, $content) { preg_match("/video_url=(.*)&/siU", $content, $link); if ($link) { $link = $link[1]; $template->addMediaItem(substr($link, strrpos($link, "/") + 1), "", $link, "", VideoUtil::getEnclosureMimetype($link)); } }
/** */ function fetchMovie($movie, $title, $image) { $template = new HdboxTemplate(); $template->setMovieTitle($title); //Parse movie page $content = getContent("hd-box.org", $movie); //print_r( $content ); preg_match("/<div class=\"element element-image first\"><a href=\"(.*)\" title=\"(.*)\"><img src=\"(.*)\"/U", $content, $image); $image = $image[3]; //print_r($image); $template->setImage($image); // <h3>Inhalt</h3><div><p align="justify"><font size="3" face="arial">Beschreibung</font> preg_match("/<h3>Inhalt<\\/h3><div><p align=\"justify\"><font size=\"3\" face=\"arial\">(.*)<\\/font>/U", $content, $desc); $description = $desc[1]; $template->setDescription($description); //Get LOOMBO.COM //src="http://loombo.com/embed-8f4pg7qrpj9s-640x318.html" preg_match("/<center><h3>Loombo<\\/h3><script type='text\\/javascript'>(.*)<\\/script><\\/div>/U", $content, $jsloombo); //var_dump($jsloombo); preg_match("/loombo\\('(.*)'\\)/siU", $jsloombo[1], $encrloombo); // var_dump($encrloombo); $popup = getContent("hd-box.org", "/i.php?alink=" . $encrloombo[1]); //var_dump($popup); $loombocontent = file_get_contents("http://loombo.com/embed-" . $popup . "-640x318.html", false, $context); // s1.addVariable('file','http://82.199.140.10:182/d/bvqqlstdyk7ad7db7un7hlawylvu7izjy5xuunbpbkto6e3w6ogpzzu6/video.flv'); preg_match("/s1\\.addVariable\\(\\'file\\',\\'(.*)\\'\\)\\;/U", $loombocontent, $links); //print_r($links); if ($links) { $link = $links[1]; $template->addMediaItem("LOOMBO: " . substr($link, strrpos($link, "/") + 1), utf8_decode($description), $link, "", VideoUtil::getEnclosureMimetype($link)); } /* Get Vidbux */ preg_match("/<center><h3>Vidbux<\\/h3><script type='text\\/javascript'>(.*)<\\/script>/U", $content, $match); $t1 = explode("innerHTML|u0075|u002D", $match[0]); $t2 = explode("|", $t1[1]); $id = $t2[0]; $filelink = "http://www.vidbux.com/embed-" . $id . "-width-653-height-362.html"; $h = file_get_contents($filelink); $link = get_unpack(1, 8, 4, $h); if ($link != "") { $template->addMediaItem("Vidbux: " . substr($link, strrpos($link, "/") + 1), utf8_decode($description), $link, "", VideoUtil::getEnclosureMimetype($link)); } /* Get Vidxden */ preg_match("/<center><h3>Vidxden<\\/h3><script type='text\\/javascript'>(.*)<\\/script>/U", $content, $match); $t1 = explode("innerHTML|u002D", $match[0]); $t2 = explode("|", $t1[1]); $id = $t2[0]; $filelink = "http://www.vidxden.com/embed-" . $id . "-width-653-height-362.html"; $h = file_get_contents($filelink); $link = get_unpack(1, 11, 5, $h); if ($link != "") { $template->addMediaItem("Vidxden: " . substr($link, strrpos($link, "/") + 1), utf8_decode($description[1]), $link, "", VideoUtil::getEnclosureMimetype($link)); } $template->generateView(HdboxTemplate::VIEW_MOVIE_DETAIL); }
function addMegavideoLink($template, $megavideo_id) { //If megaupload cookie is defined, use it if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { $template->addMediaItem($array[0], "", $array[1], "", $array[2]); } } }
function addMegavideoLink($url) { // ADD &PartNo=1 $content = file_get_contents($url, false, getExplorerContext(getSiteHash())); $content = str_replace("\\", "", $content); //Get movie files preg_match("|www.megavideo.com\\/v\\/(.*)\"|U", $content, $links); if ($links) { $megavideo_id = $links[1]; if (COOKIE_STATE_ACTIVATED && $megavideo_id) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { return $array[1]; } } } }
/** * Prints first available episode link. */ function printSerieEpisodeLink($episodeLink) { //Get page content $content = file_get_contents($episodeLink); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode(utf8_decode($content), ENT_QUOTES)); if (strpos($content, "http://www.megavideo.com/v")) { $regex = "|www.megavideo.com\\/v\\/(.*)\"|U"; } else { if (strpos($content, "&v=")) { $regex = "|\\&v\\=(.*)\"|U"; } else { $regex = false; } } if ($regex) { preg_match_all($regex, $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $value) { //Get megavideo id if (strlen($value) > 20) { $megavideo_id = substr($value, 0, -32); } else { $megavideo_id = $value; } //Show real link if (COOKIE_STATE_ACTIVATED && $megavideo_id) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { echo $array[1]; return; } } } } } echo "ERROR"; }
function fetchSerieSeasonEpisodeLinks($type, $episodeLink, $episodeName, $seasonTitle) { //Init template $template = new MegavideolinkTemplate(); $template->setType($type); //recover session data $template->setSerieTitle($_SESSION["serieTitle"]); $template->setEpisodeTitle($episodeName); $template->setSeasonTitle($seasonTitle); $seasons = unserialize($_SESSION["seasonTitle"]); //Get page content $content = @file_get_contents($episodeLink); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode(utf8_decode($content), ENT_QUOTES)); $_SESSION["megavideolinkLastReferer"] = $episodeLink; if (strpos($content, "<strong>DESCRIPTION</strong>")) { $content = strstr($content, "<strong>DESCRIPTION</strong>"); $content = strstr($content, "<p>"); $description = substr($content, 0, strpos($content, "</p>")); $description = str_replace("<p>", "", $description); $template->setDescription($description); } if (strpos($content, "http://www.megavideo.com/v")) { $regex = "|www.megavideo.com\\/v\\/(.*)\"|U"; } else { if (strpos($content, "&v=")) { $regex = "|\\&v\\=(.*)\"|U"; } else { $regex = false; } } if ($regex) { preg_match_all($regex, $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $value) { //Get megavideo id if (strlen($value) > 20) { $newValue = VideoUtil::separateMegavideoIdWithImage($value); $megavideo_id = $newValue[0]; } else { $megavideo_id = $value; } //Show real link if (COOKIE_STATE_ACTIVATED && $megavideo_id) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { $template->addMediaItem($array[0], $description, $array[1], $movieImage, $array[2]); } } } } } //Get megaupload links if (strpos($content, "www.megaupload.com/?d=")) { preg_match_all("|www\\.megaupload\\.com\\/\\?d\\=(.*)\\s?\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megaupload_id) { if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegauploadPremiumLink($megaupload_id); if ($array) { //echo $megavideo_id; $template->addMediaItem($array[0], $description, $array[1], "", $array[2]); } } } } } //Set cover image $template->setImage($_SESSION["serieCover"]); $template->generateView(MegavideolinkTemplate::VIEW_SERIE_EPISODE_LINK, $_SESSION["serieTitle"]); }
function fetchPlaySources($type, $play) { $template = new CinetubeTemplate(); $template->setType($type); //Check for session info if (isset($_SESSION["cinetubeTitle"])) { $movieTitle = $_SESSION["cinetubeTitle"]; $description = $_SESSION["cinetubeDescription"]; $image = $_SESSION["cinetubeImage"]; $template->setMovieTitle($movieTitle); $template->setDescription($description); $template->setImage($image); } $content = file_get_contents("http://www.cinetube.es" . $play); //Get megavideo links if (strpos($content, "www.megavideo.com/?v=")) { preg_match_all("|www\\.megavideo\\.com\\/\\?v\\=(.*)\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megavideo_id) { if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { //echo $megavideo_id; $template->addMediaItem($array[0], "", $array[1], "", $array[2]); } } } } } //Get megaupload links if (strpos($content, "www.megaupload.com/?d=")) { preg_match_all("|www\\.megaupload\\.com\\/\\?d\\=(.*)\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megaupload_id) { if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegauploadPremiumLink($megaupload_id); if ($array) { //echo $megavideo_id; $template->addMediaItem($array[0], "", $array[1], "", $array[2]); } } } } } $template->generateView(CinetubeTemplate::VIEW_PLAY, ""); }
function fetchPlaySources($type, $play) { $template = new CinetubeAnimeTemplate(); $template->setType($type); $content = file_get_contents("http://www.cinetube.es" . $play); //Get megavideo links if (strpos($content, "www.megavideo.com/?v=")) { preg_match_all("|www\\.megavideo\\.com\\/\\?v\\=(.*)\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megavideo_id) { if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { //echo $megavideo_id; $template->addMediaItem($array[0], "", $array[1], "", $array[2]); } } } } } //Get megaupload links if (strpos($content, "www.megaupload.com/?d=")) { preg_match_all("|www\\.megaupload\\.com\\/\\?d\\=(.*)\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megaupload_id) { if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegauploadPremiumLink($megaupload_id); if ($array) { //echo $megavideo_id; $template->addMediaItem($array[0], "", $array[1], "", $array[2]); } } } } } $template->generateView(CinetubeAnimeTemplate::VIEW_PLAY, ""); }
function addBitloadDivxLink($template, $content) { $content = str_replace("\\", "", $content); if (preg_match_all("/http\\:\\/\\/www\\.mystream\\.to\\/file-(.*)-(.*)-(.*)\"/U", $content, $parts2, PREG_SET_ORDER)) { foreach ($parts2 as $part2) { $content = getHeadersDivx('http://www.bitload.com/d/' . $part2[1] . "/" . $part2[2] . '?m=def&c=free'); preg_match("/Set-Cookie: PHPSESSID=(.*); path=\\//", $headers[4], $sessionid); $content = file_get_contents("http://www.bitload.com/d/" . $part2[1] . "/" . $part2[2] . "?m=def&c=free&PHPSESSID=" . $sessionid); //Get final file link preg_match_all("/var url = \\'(.*)\\'/U", $content, $newLink); if ($newLink) { $newLink = $newLink[1]; $newLink = $newLink[0]; $template->addMediaItem(substr($newLink, strrpos($newLink, "/") + 1), "", $newLink, "", VideoUtil::getEnclosureMimetype($newLink)); } } } else { preg_match_all("/http\\:\\/\\/www\\.bitload\\.com\\/d\\/(.*)\"/U", $content, $parts, PREG_SET_ORDER); foreach ($parts as $part) { $content = getHeadersDivx('http://www.bitload.com/d/' . $part[1] . '?m=def&c=free'); preg_match("/Set-Cookie: PHPSESSID=(.*); path=\\//", $headers[4], $sessionid); $content = file_get_contents("http://www.bitload.com/d/" . $part[1] . "?m=def&c=free&PHPSESSID=" . $sessionid); //Get final file link preg_match_all("/var url = \\'(.*)\\'/U", $content, $newLink); if ($newLink) { $newLink = $newLink[1]; $newLink = $newLink[0]; $template->addMediaItem(substr($newLink, strrpos($newLink, "/") + 1), "", $newLink, "", VideoUtil::getEnclosureMimetype($newLink)); } } } }
/** * Show megavideo info and play link by id. */ function showMegavideoLink($megavideo_id) { $template = new MegavideoTemplate(); $database = new MegavideoDatabase(); $megavideoLink = $database->getMegavideoLinkById($megavideo_id); if (!$megavideoLink) { //Get link info and set to template $megavideoLink = getMegavideoInfo($megavideo_id); if ($megavideoLink->getId() != $megavideo_id) { $megavideo_id = $megavideoLink->getId(); } } $template->setMegavideoLink($megavideoLink); //Get enclosure link if (COOKIE_STATE_ACTIVATED && $megavideo_id) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { $template->addMediaItem(substr($array[1], strrpos($array[1], "/") + 1), "", $array[1], "", $array[2]); } } $template->generateView(MegavideoTemplate::VIEW_LINK); }
/** */ function fetchMovie($movie, $title, $image, $host) { $template = new Movie2kTemplate(); $template->setMovieTitle($title); $template->setImage($image); if ($host) { switch ($host) { case "Stream2k": $content = file_get_contents($movie, false, getCookie()); preg_match("/flashvars=\"config=(.*)\"/U", $content, $popup); //var_dump($popup); $content = file_get_contents($popup[1]); //var_dump($content); preg_match("/<file>(.*)<\\/file>/U", $content, $links); //var_dump($links); $template->addMediaItem($links[1], "", $links[1], "", VideoUtil::getEnclosureMimetype($links[1])); break; case "Novamov": $content = file_get_contents($movie, false, getCookie()); //var_dump($content); preg_match("/'http:\\/\\/www\\.novamov\\.com\\/embed\\.php\\?v=(.*)'/siU", $content, $popup); //var_dump($popup); $content = file_get_contents(substr($popup[0], 1, -1)); //var_dump($content); preg_match("/flashvars.filekey=\"(.*)\"/U", $content, $key); //var_dump($key); $content = file_get_contents("http://www.novamov.com/api/player.api.php?user=undefined&pass=undefined&file=" . $popup[1] . "&key=" . $key[1]); //var_dump($content); preg_match("/url=(.*)&title/U", $content, $links); //var_dump($links); $template->addMediaItem($links[1], "", $links[1], "", VideoUtil::getEnclosureMimetype($links[1])); break; case "Movshare": $content = file_get_contents($movie, false, getCookie()); //var_dump($content); preg_match("/http:\\/\\/www\\.movshare\\.net\\/embed\\/(.*)\\//siU", $content, $popup); //var_dump($popup); $content = file_get_contents($popup[0]); //var_dump($content); preg_match("/<param name=\"src\" value=\"(.*)\"/U", $content, $links); //var_dump($links); $template->addMediaItem($links[1], "", $links[1], "", VideoUtil::getEnclosureMimetype($links[1])); break; case "Putlocker": $content = file_get_contents($movie, false, getCookie()); //var_dump($content); preg_match("/\"http:\\/\\/www\\.putlocker\\.com\\/file\\/(.*)\"/siU", $content, $popup); //var_dump($popup); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, substr($popup[0], 1, -1)); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec($ch); //print_r($content); preg_match('|Set-Cookie: (.*);|U', $content, $cookie); preg_match("/type=\"hidden\" value=\"(.*)\" name=\"hash\"/siU", $content, $hash); //var_dump($hash); $data = "hash=" . $hash[1] . "&confirm=Please+wait+for+0+seconds"; //var_dump($data); //var_dump($cookie); curl_close($ch); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, substr($popup[0], 1, -1)); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIE, $cookie[1]); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec($ch); //var_dump($content); curl_close($ch); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.putlocker.com/get_file.php?embed_stream=" . $popup[1]); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIE, $cookie[1]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec($ch); curl_close($ch); preg_match("/<\\/link><media:content url=\"(.*)\"/U", $content, $links); //var_dump($links); $template->addMediaItem($links[1], "", $links[1], "", VideoUtil::getEnclosureMimetype($links[1])); break; case "Sockshare": $content = file_get_contents($movie, false, getCookie()); //var_dump($content); preg_match("/\"http:\\/\\/www\\.sockshare\\.com\\/file\\/(.*)\"/siU", $content, $popup); //var_dump($popup); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, substr($popup[0], 1, -1)); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec($ch); //print_r($content); preg_match('|Set-Cookie: (.*);|U', $content, $cookie); preg_match("/type=\"hidden\" value=\"(.*)\" name=\"hash\"/siU", $content, $hash); //var_dump($hash); $data = "hash=" . $hash[1] . "&confirm=Please+wait+for+0+seconds"; //var_dump($data); //var_dump($cookie); curl_close($ch); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, substr($popup[0], 1, -1)); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIE, $cookie[1]); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec($ch); //var_dump($content); curl_close($ch); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.sockshare.com/get_file.php?embed_stream=" . $popup[1]); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_COOKIE, $cookie[1]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $content = curl_exec($ch); curl_close($ch); preg_match("/<\\/link><media:content url=\"(.*)\"/U", $content, $links); //var_dump($links); $template->addMediaItem($links[1], "", $links[1], "", VideoUtil::getEnclosureMimetype($links[1])); break; case "Divxstage": $content = file_get_contents($movie, false, getCookie()); //var_dump($content); preg_match("/http:\\/\\/www\\.divxstage\\.eu\\/video\\/(.*)\"/siU", $content, $popup); //var_dump($popup); $content = file_get_contents($popup[0]); //var_dump($content); preg_match("/s1\\.addParam\\('flashvars'\\,'file=(.*)&type=video'\\)/siU", $content, $links); //var_dump($links); $template->addMediaItem($links[1], "", $links[1], "", VideoUtil::getEnclosureMimetype($links[1])); break; } } else { //Parse movie page $content = file_get_contents($movie, false, getCookie()); //var_dump($content); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8")); // var_dump($content); preg_match_all("/<tr id=\"tablemoviesindex2\">(.*)<\\/td><\\/tr>/siU", $content, $mirrors); //var_dump($mirrors); foreach ($mirrors[1] as $mirrorlink) { preg_match_all("/<a href=\"(.*)\">(.*)<img border=(.*) style=\"(.*)\" src=\"(.*)\" alt=\"(.*)\" title=\"(.*)\" width=\"(.*)\"> Â(.*)<\\/a><\\/td><td align=\"(.*)\" width=\"(.*)\"(.*)/siU", $mirrorlink, $mirror, PREG_SET_ORDER); //var_dump($mirror); //preg_match("/<div class=\"beschreibung\">(.*)<iframe/U", $content, $desc); //$description = $desc; //$template->setDescription($description[1]); //Get megavideo id and link //preg_match("/flashvars=\"config=(.*)\"/U", $content, $popup); //var_dump($popup); //$content = file_get_contents($popup[1]); //var_dump($content); //preg_match("/<file>(.*)<\/file>/U", $content, $links); //var_dump($links); if ($mirror) { $template->addItem(substr($mirror[0][9], 1), $mirror[0][2], SCRAPER_URL . "index.php?title=" . base64_encode($title) . URL_AMP . "item=" . base64_encode("http://movie2k.to/" . $mirror[0][1]) . URL_AMP . "host=" . base64_encode(substr($mirror[0][9], 1)) . URL_AMP . "image=" . base64_encode($image), ""); } } } $template->generateView(Movie2kTemplate::VIEW_MOVIE_DETAIL); }
/** */ function fetchMovie($movie, $title, $image) { $template = new HdboxTemplate(); $template->setMovieTitle($title); $template->setImage($image); //Parse movie page $content = file_get_contents("http://hd-box.org" . $movie); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8")); preg_match("/<div class=\"element element-textareafirst\"><div><p align=\"justify\"><font size=\"3\" face=\"arial\">(.*)<\\/font><\\/p><\\/div><\\/div>/U", $content, $desc); $description = $desc; $template->setDescription($description[1]); //Get LOOMBO.COM preg_match("/src=\\'http:\\/\\/loombo.com\\/(.*)\\'/U", $content, $popup); //var_dump($popup); $content = file_get_contents("http://loombo.com/" . $popup[1]); //var_dump($content); preg_match("/\\(\\'flashvars\\',\\'file=(.*)\\'\\)\\;/U", $content, $links); //var_dump($links); if ($links) { $link = $links[1]; $template->addMediaItem(substr($link, strrpos($link, "/") + 1), utf8_decode($description[1]), $link, "", VideoUtil::getEnclosureMimetype($link)); } /* Get Vidbux //var_dump($content); preg_match("/SRC=\"http:\/\/www.vidbux.com\/(.*)\"/U", $content, $popup); //var_dump($popup); $content = file_get_contents("http://vidbux.com/".$popup[1]); preg_match("/flashvars=\"file=(.*)&type=(.*)\"/U", $content, $links); var_dump($links); if($links) { $link = $links[1]; $template->addMediaItem( substr($link, strrpos($link,"/")+1), utf8_decode($description[1]), $link, "", VideoUtil::getEnclosureMimetype($link) ); } */ $template->generateView(HdboxTemplate::VIEW_MOVIE_DETAIL); }
function fetchMovie($item, $title, $image) { $template = new KinostreamingTemplate(); $template->setMovieTitle($title); //Start session if (isset($_GET["PHPSESID"])) { session_id($_GET["PHPSESID"]); } session_start(); //Parse movie page $content = file_get_contents($item); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", utf8_decode($content)); if (strpos($content, "<strong>DESCRIPTION</strong>")) { $content = strstr($content, "<strong>DESCRIPTION</strong>"); $content = strstr($content, "<p>"); $description = substr($content, 0, strrpos($content, "</p>")); $description = str_replace("<p>", "", $description); $template->setDescription($description); } if (strpos($content, "http://www.megavideo.com/v")) { $regex = "|www.megavideo.com\\/v\\/(.*)\"|U"; } else { if (strpos($content, "&v=")) { $regex = "|\\&v\\=(.*)\"|U"; } else { $regex = false; } } if ($regex) { preg_match_all($regex, $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $value) { //Get megavideo id if (count_chars($value) > 20) { $megavideo_id = substr($value, 0, -32); } else { $megavideo_id = $value; } if (COOKIE_STATE_ACTIVATED && $megavideo_id) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { $template->addMediaItem($array[0], $description, $array[1], "", $array[2]); } } } } } //Get megaupload links if (strpos($content, "www.megaupload.com/?d=")) { preg_match_all("|www\\.megaupload\\.com\\/\\?d\\=(.*)\\s?\" class\\=\"Stylehopbleu\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $megaupload_id) { if (COOKIE_STATE_ACTIVATED) { $array = VideoUtil::generateMegauploadPremiumLink($megaupload_id); if ($array) { //echo $megavideo_id; $template->addMediaItem($array[0], $description, $array[1], "", $array[2]); } } } } } $content = strstr($content, "yapb_cache/"); $image = "http://www.megavideolink.com/wp-content/uploads/" . substr($content, 0, strpos($content, '"')); $template->setImage($image); $template->generateView(KinostreamingTemplate::VIEW_MOVIE_DETAIL); }
/** */ function fetchMovie($movie, $title, $image) { $template = new MarocTemplate(); $template->setMovieTitle($title); $template->setImage($image); //Parse movie page $content = file_get_contents($movie); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content, ENT_QUOTES, "UTF-8")); $content = strstr($content, "<fieldset class=\"film_description\">"); $content = strstr($content, "</table>"); $description = substr($content, 8, strpos($content, "</fieldset>") - 8); $template->setDescription($description); //Get megavideo id and link preg_match("/wwwstatic.megavideo.com\\/mv_player.swf(.*)&v=(.*)\"/siU", $content, $links); if ($links && $links[2]) { $megavideo_id = $links[2]; if (COOKIE_STATE_ACTIVATED && $megavideo_id) { $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); if ($array) { $template->addMediaItem($title, $description, $array[1], "", $image); } } } $template->generateView(MarocTemplate::VIEW_MOVIE_DETAIL); }
function fetchMovie($movieId, $title, $movieImage) { global $template; $content = file_get_contents($movieId); $newlines = array("\t", "\n", "\r", " ", "", "\v"); $content = str_replace($newlines, "", html_entity_decode($content)); //Check for different format preg_match("/<div class\\=\"singletext\">(.*)<p><img src\\=\"(.*)\"(.*)>(.*)<\\/p>/U", $content, $divs); if (strpos($divs[4], "br />")) { preg_match("/<div class\\=\"singletext\">(.*)<p><img src\\=\"(.*)\"(.*)><br \\/>(.*)<\\/p>/U", $content, $divs); if ($divs) { $description = $divs[4]; $template->setDescription($description); $image = $divs[2]; $template->setImage($image); } } else { $newlines = array("<strong>", "</strong>"); preg_match("/<div class\\=\"singletext\">(.*)<p><img src\\=\"(.*)\"(.*)>(.*)<\\/p><p>(.*)<\\/p>/U", $content, $divs); if ($divs) { $description = str_replace($newlines, "", $divs[5]); $template->setDescription($description); $image = $divs[2]; $template->setImage($image); } } //<li class="online"> //Get film avaible links if (strpos($content, "http://www.megavideo.com/v")) { preg_match_all("|www.megavideo.com\\/v\\/(.*)\"|U", $content, $links); if ($links && $links[1]) { $links = $links[1]; $links = array_unique($links); foreach ($links as $value) { //Get megavideo id if (strlen($value) > 40) { $value = separateMegavideoIdWithImage($value); $megavideo_id = $value[0]; } else { $megavideo_id = substr($value, 0, -32); } if ($megavideo_id) { //If megaupload cookie is defined, use it, in other case, use alternative method if (COOKIE_STATE_ACTIVATED) { //generateMegavideoPremiumLink($tempTitle, $imageUrl, $counter, $megavideo_id); $array = VideoUtil::generateMegavideoPremiumLink($megavideo_id); $unicodeLink = html_entity_decode($array[1], ENT_QUOTES, "UTF-8"); $unicodeTitle = html_entity_decode($array[0], ENT_QUOTES, "UTF-8"); $template->addMediaItem($unicodeTitle, "", $unicodeLink, $movieImage, $array[2]); } } } } } else { if (strpos($content, "http://www.youtube.com/v")) { // $link = substr($content, strpos($content, "http://www.youtube.com/v")); // $link = substr($link, strpos($link, "v/")+2); // $link = "http://www.youtube.com/get_video?video_id=" . substr($link, 0, strpos($link,"&")); // $template->addMediaItem( // "[Youtube] ".$title, // "", // $link, // $movieImage, // "video/x-flv" // ); } } $template->generateView(MyvodtvTemplate::VIEW_PLAY, $title); }