How to download the original course files?
playgithub opened this issue · 1 comments
playgithub commented
For I'm going to use the files to play in the game, the files are
.bcd files for levels
.btl files for thumbnails (optional)
I've checked TheGreatRambler/mm2_level.
It seems that the field level_data
is decrypted already, so it can't be used in the game directly.
TheGreatRambler commented
You can use this Go library made by the OpenCourseWorld team to reencrypt a level file. For example:
import (
"os"
"github.com/mm2srv/smm2_parsing"
)
compressed, err := os.ReadFile("test.bcd")
if err != nil {
return err
}
decrypted, err := smm2_parsing.Decompress(encrypted)
if err != nil {
return err
}
encrypted, err := smm2_parsing.EncryptLevel(decrypted)
if err != nil {
return err
}
err = os.WriteFile("test_for_game.bcd", encrypted, 0644)
if err != nil {
return err
}