public function getEmbeds($title, $season, $episode, $domainfilters, $limit, $checkfake = null) { $sidereel_url = $this->grabURL($title); $link = $sidereel_url . "/season-{$season}/episode-{$episode}/search"; $p = 1; $embeds = array(); $counter = 1; $this->curl->setAjax(); while (1) { $pagelink = $link . "?page=" . $p; $page = $this->curl->get($pagelink); $info = $this->curl->getInfo(); if ($info['http_code'] == 404) { return $embeds; } $dom = new DOMDocument(); @$dom->loadHTML($page); $divs = $dom->getElementsByTagName('div'); $founddiv = 0; $foundembeds = array(); for ($i = 0; $i < $divs->length; $i++) { if (substr_count($divs->item($i)->getAttribute("class"), "link-results")) { $founddiv = 1; $ul = $divs->item($i)->getElementsByTagName('ul')->item(0); $lis = $ul->getElementsByTagName('li'); if ($lis->length == 0) { return $embeds; } for ($j = 0; $j < $lis->length; $j++) { $links = $lis->item($j)->getElementsByTagName('a'); for ($k = 0; $k < $links->length; $k++) { if (substr_count($links->item($k)->getAttribute("class"), "direct-link")) { $url = $links->item($k)->getAttribute("href"); $domain = $this->getDomain($url); print $domain . "<br />"; if (in_array($domain, $domainfilters)) { if ($domain == 'megavideo.com') { // megavideo if (substr_count($url, "?v=")) { $tmp = explode("?v=", $url); $id = $tmp[1]; } elseif (substr_count($url, "?d=")) { $megapage = $this->curl->get($url); $tmp = explode('flashvars.embed = "', $megapage); $megapage = @$tmp[1]; $tmp = explode('";', $megapage); $embed = urldecode($tmp[0]); $tmp = explode("http://www.megavideo.com/v/", $embed); $embed = @$tmp[1]; $tmp = explode('">', $embed); $id = $tmp[0]; } else { $id = ''; } if ($id) { if ($checkfake) { $mega = new Megavideo($id); $duration = @$mega->get(duration); } else { $duration = "15:00"; } $check = $this->curl->get("http://www.megavideo.com/?v={$id}"); if (substr_count($check, "This video has been removed") > 0 || substr_count($check, "This video is unavailable")) { $duration = '10:00'; } if ($duration > "10:00" || !$duration) { $embeds[$counter] = array(); $embeds[$counter]['info'] = ''; $embeds[$counter]['embed'] = "<object width=\"420\" height=\"382\"><param name=\"movie\" value=\"http://www.megavideo.com/v/{$id}\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"http://www.megavideo.com/v/{$id}\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"420\" height=\"382\"></embed></object>"; $embeds[$counter]['value'] = urlencode($embeds[$counter]['embed']); $counter++; } } } elseif ($domain == 'divxden.com') { // divxden $url = str_replace("http://", "", $url); $url = explode("/", $url); $id = @$url[1]; if ($id) { $embed = '<IFRAME SRC="http://www.divxden.com/embed-' . $id . '-width-653-height-362.html" FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=653 HEIGHT=362></IFRAME>'; if (!in_array($embed, $foundembeds)) { $foundembeds[] = $embed; $embeds[$counter] = array(); $embeds[$counter]['value'] = urlencode($embed); $embeds[$counter]['info'] = ''; $embeds[$counter]['embed'] = $embed; $counter++; } } } elseif ($domain == 'zshare.net') { // zshare $zs = $this->curl->get($url); if (substr_count($zs, "Error 404") == 0) { preg_match("/http:\\/\\/www\\.zshare\\.net\\/videoplayer\\/([^\"\\']*)/", $zs, $matches, PREG_OFFSET_CAPTURE, 3); $id = @$matches[1][0]; if ($id) { $embed = "http://www.zshare.net/videoplayer/" . $id; $embed = "<iframe src='{$embed}' width='660' height='420' scrolling='no' frameborder='0' style='width:100%'></iframe>"; if (!in_array($embed, $foundembeds)) { $foundembeds[] = $embed; $embeds[$counter] = array(); $embeds[$counter]['info'] = "All zShare link requires activation(meaning you have to visit the link at least once to activate the video). Please <a href='{$embed}' target='_blank'>click here</a> to activate this video"; $embeds[$counter]['embed'] = $embed; $embeds[$counter]['value'] = urlencode($embeds[$counter]['embed']); $counter++; } } } } elseif ($domain == 'fancast.com') { //fancast $embed = str_replace("/videos", "/embed?skipTo=0", $url); $embed = "<iframe src='{$embed}' width='420' height='382' scrolling='no' frameborder='0'></iframe>"; if (!in_array($embed, $foundembeds)) { $foundembeds[] = $embed; $embeds[$counter] = array(); $embeds[$counter]['info'] = ''; $embeds[$counter]['embed'] = $embed; $embeds[$counter]['value'] = urlencode($embeds[$counter]['embed']); $counter++; } } elseif ($domain == 'videobb.com') { if (substr_count($url, "/video/")) { $id = explode("/video/", $url); $id = $id[1]; $embed = "<object id='vbbplayer' width='425' height='344' classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ><param name='movie' value='http://www.videobb.com/e/{$id}' ></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='http://www.videobb.com/e/{$id}' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='425' height='344'></embed></object>"; if (!in_array($embed, $foundembeds)) { $foundembeds[] = $embed; $embeds[$counter]['info'] = ''; $embeds[$counter]['embed'] = $embed; $embeds[$counter]['value'] = urlencode($embeds[$counter]['embed']); $counter++; } } } elseif ($domain == 'vidxden.com') { $link = str_replace("http://", "", $url); $tmp = explode("/", $link); if (count($tmp) == 3) { $videoid = $tmp[1]; $embed = "<IFRAME SRC='http://www.vidxden.com/embed-{$videoid}-width-653-height-362.html' FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=653 HEIGHT=362></IFRAME>"; $foundembeds[] = $embed; $embeds[$counter]['info'] = ''; $embeds[$counter]['embed'] = $embed; $embeds[$counter]['value'] = urlencode($embeds[$counter]['embed']); $counter++; } } elseif ($domain == 'novamov.com') { if (substr_count($url, "novamov.com/video/") == 0) { $url = ''; } if ($url) { $url = str_replace("http://", "", $url); $tmp = explode("/", $url); $videoid = $tmp[2]; $embed = "<iframe style='overflow: hidden; border: 0; width: 555px; height: 430px' src='http://embed.novamov.com/embed.php?width=555&height=480&v={$videoid}' scrolling='no'></iframe>"; $foundembeds[] = $embed; $embeds[$counter]['info'] = ''; $embeds[$counter]['embed'] = $embed; $embeds[$counter]['value'] = urlencode($embeds[$counter]['embed']); $counter++; } } else { print $domain . " - " . $url . "<br />"; } } if ($counter > $limit) { return $embeds; } } } } break; } } if (!$founddiv) { break; } $p++; } return $embeds; }
public function getRating() { $this->_fetch(); return $this->_fetched->get('RATING'); }
<?php require_once 'Megavideo.class.php'; $url = !empty($_REQUEST['url']) ? $_REQUEST['url'] : 'http://www.megavideo.com/?v=6PTHEVUY'; $mv = new Megavideo($url); //Setup the URL # Work to get the link $mv->doScrape(); # You now have the link echo $mv->getLink(); # The link can be used for download or stream # To use for stream, you will need a flash player like JW Flash Player # http://www.longtailvideo.com/players/jw-flv-player/ $old_mv = $mv->oldMegavideo($url); print "-- Megavideo Downloader by luruke --\n"; print "URL download:..........{$old_mv->get(url)}\n"; print "Title:.................{$old_mv->get(title)}\n"; print "Duration:..............{$old_mv->get(duration)}m\n"; print "Size:..................{$old_mv->get(size)}Mb\n"; //system("firefox ".$obj->get(url));