<?php require_once 'mega.class.php'; $megafile = new MEGA('https://mega.co.nz/#!yl5EFARS!c6T1en1P8N9GuQzsMy5iCh2U9NEmuqTvSd4KkW42UX4'); //$megafile->download(); // OR $megafile->stream_download(); // to download using streams
function downloadmega($hash) { error_reporting(0); $job = $this->lookup_job($hash); if (!$job) { sleep(15); header("HTTP/1.1 404 Not Found"); die($this->lang['errorget']); } if ($_SERVER['REMOTE_ADDR'] !== $job['ip'] && $this->privateip == true) { sleep(15); die($this->lang['errordl']); } if ($this->get_load() > $this->max_load) { sleep(15); } $megafile = new MEGA(urldecode($job['url'])); $megafile->stream_download(); }