public function saveImage($imagePath, $saveDirPath, $separator = '-'): string
    {
        if (strpos($image = str_replace(' ', '%20', $imagePath), DIRECTORY_SEPARATOR) !== false) {
            $filename = str_replace('%20', $separator, pathinfo($image, PATHINFO_BASENAME));
            if (!empty($filename)) {
                $savePath = preg_replace(
                    '~/+~',
                    DIRECTORY_SEPARATOR,
                    implode(DIRECTORY_SEPARATOR, [$saveDirPath, $filename])
                );
                if (!file_exists($savePath)) {
                    try {
                        is_dir($saveDirPath) || mkdir($saveDirPath, 0777, true);
                        copy($image, $savePath);
                        return $savePath;
                    } catch (\Exception $e) {
                        if (strpos($_SERVER['argv'][0], 'phpunit') === false) {
                            echo 'Failed to download image, located at ' . $imagePath . ', Error: ' . $e->getMessage();
                            echo "\n";
                        }
                    }
                } else {
                    return $savePath;
                }
            }
        }
        return '';
    }