GetPage($link); if (!preg_match('@sGlobalContentID\s?=\s?[\"\']?(\d+)[\"\']?@i', $page, $id)) html_error('Video ID not found.'); $page = $this->GetPage('http://api.break.com/invoke/content/' . $id[1]); $xml = substr($page, strpos($page, "\r\n\r\n") + 4); $xml = substr($xml, 0, strpos($xml, '')+27); $title = cut_str($xml, ''); if (empty($title)) html_error('Video Title not found.'); $badchars = '<>:"/\\|?*\'@#+~{}[]^'; $title = str_replace(str_split($badchars), '_', trim($title)); $stream = preg_match('@(https?://[^\r\n\'\"\t\s<>]+)@i', $xml, $flv) ? array(array('title' => '[FLV] Default', 'link' => $flv[1])) : array(); if (preg_match_all('@]+)"[^<>]+\sname="([^\"<>]+)"@i', $xml, $matches)) { $matches = array_combine($matches[2], $matches[1]); foreach ($matches as $vt => $vl) { if (strtolower(strrchr($vl, '.')) == '.mp4') $vt = "[MP4] $vt"; $stream[] = array('title' => $vt, 'link' => $vl); } } if (empty($stream)) html_error('Download links not found.'); elseif (count($stream) == 1) $_REQUEST['br_qs'] = 1; $br_qs = !empty($_REQUEST['br_qs']) && $_REQUEST['br_qs'] > 0 ? $_REQUEST['br_qs'] - 1 : false; if ($br_qs !== false) { if (empty($stream[$br_qs])) { $this->changeMesg(lang(300)."
Error: Requested video format not found, using \"{$stream[0]['title']}\"."); $dllink = $stream[0]['link']; } else $dllink = $stream[$br_qs]['link']; } else { global $PHP_SELF; echo "\n

This video have more than 1 stream, please select one for download.

"; echo "\n
\n"; echo "\n"; $data = $this->DefaultParamArr($link); foreach ( $data as $n => $v ) echo("\n"); echo "\n"; echo "
\n\n"; exit; } $ext = strrchr($dllink, '.');if (empty($ext)) $ext = '.flv'; $fname = $title . $ext; $this->RedirectDownload($dllink, $fname, 0, 0, 0, $fname); } } //[31-8-2012] Written by Th3-822. ?>