added options for tracking youtube-dl downloads;bugs fixing

This commit is contained in:
huangjx
2021-09-14 22:58:36 +08:00
parent ced82caf0a
commit 2e834d4f9c
23 changed files with 649 additions and 182 deletions

View File

@@ -162,8 +162,11 @@ class Aria2
{
$this->filterResponse = false;
$resp = $this->tellStopped($range);
if (!isset($resp['result'])) {
return [];
}
$result = $this->sortDownloadsResult($resp['result'], ['complete', 'removed']);
$this->filterResponse = true;;
$this->filterResponse = true;
return $result;
}
public function getCounters()
@@ -268,6 +271,21 @@ class Aria2
$this->start();
}
public function download(String $url)
{
$resp = $this->addUri([$url]);
if (isset($resp['error'])) {
return $resp;
}
if (isset($resp['result']) && is_string($gid = $resp['result'])) {
return $gid;
}
return false;
}
public function getDefaults()
{
return [