snobu / destreamer

Save Microsoft Stream videos for offline enjoyment.
MIT License
2.36k stars 442 forks source link

Changed 'aria2c --version' to 'LANG=en_US.UTF-8 aria2c --version' for consistent environment #495

Open kei1-st opened 2 months ago

kei1-st commented 2 months ago

In my environment, $LANG=ja_JP.UTF-8 is set by default and the output of aria2c --version is in Japanese.

In that case, the value of the aria2Ver is "aria2 バージョン" instead of "aria2 version", which does not match versionRegex = RegExp(/aria2 version (. *)/) and followiing process throws an error.

https://github.com/snobu/destreamer/blob/e93ad80ef6fcffb7d25936ffb4c9cf9a3d2d6f4e/src/Utils.ts#L216-L229

To solve this problem, change execSync('aria2c --version') to execSync('LANG=en_US.UTF-8 aria2c --version') so that the output of the command aria2c --version is always in English.