standalone/getfile.php

28 lines
672 B
PHP
Raw Normal View History

2019-04-12 15:40:27 +02:00
<?php
$updateId = isset($argv[1]) ? $argv[1] : null;
2019-04-27 21:01:25 +02:00
$file = isset($argv[2]) ? strtolower($argv[2]) : null;
2019-04-12 15:40:27 +02:00
if(empty($updateId)) die('Unspecified update id');
if(empty($file)) die('Unspecified file');
2019-04-27 21:01:25 +02:00
require_once dirname(__FILE__).'/shared/main.php';
2019-04-12 15:40:27 +02:00
require_once dirname(__FILE__).'/api/get.php';
2019-04-27 21:01:25 +02:00
consoleLogger(brand());
2019-04-12 15:40:27 +02:00
$files = uupGetFiles($updateId, 0, 0);
if(isset($files['error'])) {
throwError($files['error']);
}
$files = $files['files'];
$filesKeys = array_keys($files);
if(!isset($files[$file]['url'])) {
throwError('NO_FILES');
}
echo $files[$file]['url']."\n";
echo ' out='.$file."\n";
echo ' checksum=sha-1='.$files[$file]['sha1']."\n\n";
?>