function cacheurl($url, $browser_req = true, $cookies = "", $browser = "Firefox") { global $myconfig; #find cache file $hash = md5($url); $datei = "cache/" . $hash; if (file_exists($datei)) { if (time() - filemtime($datei) < $myconfig['cachetime']) { return implode('', file($datei)); } } #no cache file exists send browser request if ($browser_req == true) { $objekt = new Browser($browser); if ($cookies != "") { $objekt->cookies_set($cookies); } $objekt->url = $url; $t_html = $objekt->read(); } else { $t_html = implode('', file($url)); } d_write($datei, $t_html); return $t_html; }
/** * Parse the video url of a given myvideo video link site * and returns the http url of the video * * * @param string $url * url of video must contain watch/* * http://www.myvideo.de/watch/7125794 * @return string * the url of the video as http url; should the flv file */ function myvideo_flv_download($url) { preg_match('|watch/(\\d+)/|i', $url, $match); $objekt = new Browser($browser); if ($cookies != "") { $objekt->cookies_set($cookies); } $objekt->url = "http://www.myvideo.de/movie/" . $match[1]; $objekt->read(); $head = $objekt->returnHeader(); preg_match('/V\\=(.*?).flv/', $head['Location'], $matches); return urldecode($matches[1]) . ".flv"; }
function sub_navi2($url) { $z = split(",", trim($url['keys'], "()")); $objekt = new Browser("Firefox"); $objekt->url = $url['url']; $objekt->post = array("xajax" => "show_top_and_movies&xajaxr=1205505927158&xajaxargs[]=0&xajaxargs[]=" . trim($z[1], "'") . "&xajaxargs[]=" . trim($z[2], "'") . "&xajaxargs[]=0&xajaxargs[]=0&xajaxargs[]=0"); $t_html = $objekt->read(); # preg_match_all('|div class="number">(.*?)</div><div class="time">(.*?)</div>(?:.*?)<div class="buy">(?:.*?)<a href=(.*?)>ansehen</a>(?:.*?)<div class="title" >(?:.*?)>(.*?)</a>|si',$t_html,$matches); preg_match_all('|href(?:.*?)>(?:.*?)</a>(?:.*?)</a>|si', $t_html, $matches); foreach ($matches[0] as $row) { $row = "<a " . $row; $row = str_replace(">.<", "", $row); $row = str_replace(">0.<", "", $row); $row = str_replace("kostenlos", "", $row); $row = trim($row); preg_match('|href="(.*?)">|si', $t_html, $link); $tmp_array['url'] = "http://rtl-now.rtl.de/" . str_replace("_produktdetail", "", $link[1]) . "&player=1"; # $tmp_array['time']=strtotime($matches[2][$key]); $tmp_array['title'] = reducehtml(strip_tags($row)); $tmp_array['type'] = "file"; $out[$tmp_array['title']] = $tmp_array; } return $out; }