standalone/getfile.php

26 lines
585 B
PHP
Raw Normal View History

2019-04-12 15:40:27 +02:00
<?php
$updateId = isset($argv[1]) ? $argv[1] : null;
$file = isset($argv[2]) ? $argv[2] : null;
if(empty($updateId)) die('Unspecified update id');
if(empty($file)) die('Unspecified file');
require_once dirname(__FILE__).'/api/get.php';
$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";
?>