This commit is contained in:
2024-01-11 12:42:03 +00:00
parent c7cd2fbbca
commit 4b11b32cbc
2 changed files with 5 additions and 3 deletions

View File

@@ -7,9 +7,9 @@ class MultiDownloaderClient
private string $apiUrl = 'https://multi-dl.kub.nwb.fr';
private string $apiKey;
public function __construct(string $apiKey = null)
public function __construct(array $options = [])
{
$apiKey = $apiKey ?? getenv('MULTI_DOWNLOADER_API_KEY');
$apiKey = $options['apiKey'] ?? getenv('MULTI_DOWNLOADER_API_KEY');
if (!$apiKey) {
throw new \InvalidArgumentException('API key is required');