chore: Update yt-dlp path in Config class

Changes the path of yt-dlp executable to '/usr/bin/yt-dlp' for better compatibility with system installations. This ensures that the program uses the correct binary location, potentially improving performance and simplifying deployment configurations.
This commit is contained in:
Kumi 2024-12-14 17:22:09 +01:00
parent 4c8a8dbbe7
commit 81b064ce90
Signed by: kumi
GPG key ID: ECBCC9082395383F

View file

@ -24,7 +24,7 @@ class Config
* *
* @var string * @var string
*/ */
public string $youtubedl = 'vendor/yt-dlp/yt-dlp/yt_dlp/__main__.py'; public string $youtubedl = '/usr/bin/yt-dlp';
/** /**
* python binary path. * python binary path.
@ -276,7 +276,9 @@ class Config
public static function fromFile(string $file): Config public static function fromFile(string $file): Config
{ {
if (is_file($file)) { if (is_file($file)) {
return new self(Yaml::parse(strval(file_get_contents($file)))); $yaml = Yaml::parse(strval(file_get_contents($file)));
assert(is_array($yaml));
return new self($yaml);
} else { } else {
throw new ConfigException("Can't find config file at " . $file); throw new ConfigException("Can't find config file at " . $file);
} }