$rename = false; $showHeader = true; $start = 0; $update = false; $options = array(0 => array('help' => 'displays this help', 'debug' => 'show debug output', 'delete' => 'delete fragments after processing', 'fproxy' => 'force proxy for downloading of fragments', 'play' => 'dump stream to stdout for piping to media player', 'rename' => 'rename fragments sequentially before processing', 'update' => 'update the script to current git version'), 1 => array('auth' => 'authentication string for fragment requests', 'duration' => 'stop recording after specified number of seconds', 'filesize' => 'split output file in chunks of specified size (MB)', 'fragments' => 'base filename for fragments', 'fixwindow' => 'timestamp gap between frames to consider as timeshift', 'manifest' => 'manifest file for downloading of fragments', 'maxspeed' => 'maximum bandwidth consumption (KB) for fragment downloading', 'outdir' => 'destination folder for output file', 'outfile' => 'filename to use for output file', 'parallel' => 'number of fragments to download simultaneously', 'proxy' => 'proxy for downloading of manifest', 'quality' => 'selected quality level (low|medium|high) or exact bitrate', 'referrer' => 'Referer to use for emulation of browser requests', 'start' => 'start from specified fragment', 'useragent' => 'User-Agent to use for emulation of browser requests')); $cli = new CLI($options, true); // Set large enough memory limit ini_set("memory_limit", "512M"); // Check if STDOUT is available if ($cli->getParam('play')) { $play = true; $quiet = true; $showHeader = false; } if ($cli->getParam('help')) { $cli->displayHelp(); exit(0); } // Check for required extensions $required_extensions = array("bcmath", "curl", "SimpleXML"); $missing_extensions = array_diff($required_extensions, get_loaded_extensions()); if ($missing_extensions) { $msg = "You have to install the following extension(s) to continue: '" . implode("', '", $missing_extensions) . "'"; LogError($msg); } // Initialize classes $cc = new cURL(); $f4f = new F4F(); $f4f->baseFilename =& $baseFilename; $f4f->debug =& $debug; $f4f->fixWindow =& $fixWindow;