예제 #1
0
/**
 * 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";
}
function addMegavideoLink($template, $url)
{
    // ADD  &PartNo=1
    $content = file_get_contents($url, false, getExplorerContext(getSiteHash()));
    $content = str_replace("\\", "", $content);
    //Get movie files
    preg_match_all("/PartNo=(.*)\"/U", $content, $parts, PREG_SET_ORDER);
    if ($parts) {
        foreach ($parts as $part) {
            $content = file_get_contents($url . "&PartNo=" . $part[1], false, getExplorerContext(getSiteHash()));
            $content = str_replace("\\", "", $content);
            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) {
                        $template->addMediaItem($array[0], "", $array[1], "", $array[2]);
                    }
                }
            }
        }
    } else {
        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) {
                    $template->addMediaItem($array[0], "", $array[1], "", $array[2]);
                }
            }
        }
    }
}
예제 #3
0
/**
 * 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;
    }
}
예제 #4
0
/**
 * 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";
}
예제 #5
0
/**
 * 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>';
 }
 /**
  * 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";
 }
예제 #8
0
function addMegavideoLink($template, $content)
{
    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) {
            //Parse and get megavideo id
            if (strpos($value, ".")) {
                $value = substr($value, 0, strpos($value, "."));
            }
            $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) {
                        $template->addMediaItem($array[0], "", $array[1], "", $array[2]);
                    }
                }
            }
        }
    }
}
예제 #9
0
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];
            }
        }
    }
}
예제 #10
0
/**
 * 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";
}
예제 #11
0
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);
}
예제 #12
0
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"]);
}
예제 #13
0
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, "");
}
예제 #14
0
function addMegavideoLink($template, $content)
{
    $content = str_replace("\\", "", $content);
    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) {
                $template->addMediaItem($array[0], "", $array[1], "", $array[2]);
            }
        }
    }
}
예제 #15
0
/**
 * 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);
}
예제 #16
0
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]);
        }
    }
}
예제 #17
0
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, "");
}
예제 #18
0
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);
    }
}
예제 #19
0
/**
 */
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);
}
예제 #20
0
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);
}