Add alt download for Downloader (#706)

* Add alt download for Downloader

* Test broken url

* Break another source

* Good!

* Rename alt_sources variable

* Use SPC_DOWNLOAD_RETRIES instead of SPC_RETRY_TIME

* Apply new curlExec args
This commit is contained in:
Jerry Ma
2025-04-22 20:25:44 +08:00
committed by GitHub
parent 637ae89583
commit 455ed7d503
4 changed files with 74 additions and 19 deletions

View File

@@ -477,6 +477,11 @@ class Downloader
);
break;
case 'custom': // Custom download method, like API-based download or other
if (isset($source['func']) && is_callable($source['func'])) {
$source['name'] = $name;
$source['func']($force, $source, $download_as);
break;
}
$classes = FileSystem::getClassesPsr4(ROOT_DIR . '/src/SPC/store/source', 'SPC\store\source');
foreach ($classes as $class) {
if (is_a($class, CustomSourceBase::class, true) && $class::NAME === $name) {