I've made a script and tested it for some time:
#!/usr/bin/env python3
from subprocess import check_output
from tqdm import tqdm
import base58
import binascii
import bitcoin
import hashlib
import subprocess
outfile = open("output.txt","wb")
cnt=int(check_output(["wc", "-l", "input.txt"]).split()[0])
with open("input.txt","rb") as f:
for line in tqdm(f, total=cnt, unit=" lines"):
x=line.rstrip(b'\n')
b=hashlib.sha256(x).digest()
f=b'\x80'+b
h=base58.b58encode_check(f)
i=h+b" 0 # "+x+b'\n'
outfile.write(i)
outfile.close()
This is Python 3 script. Works on Windows and decent Linux.
You put it into empty folder, name it "text2wif.py" and put in the same folder "input.txt" file with your brain wallets. One per line. Accepted line endings are only \n. If you have \r or \r\n you need to convert the file with dos2unix or other editor which changes line endings to Linux (\n).
Then you run the script. "wc" is needed, it is available in GNU CoreUtils for Windows.
You get progress bar and very high speed (I get 80k lines/s).
Some imports are not needed. You may need to install some imports by "pip install ...".
The result you get in "output.txt" file.
This file is ready to import in Bitcoin Core with "importwallet" command.
Script may be helpful to recall forgotten brain wallet phrases.
EDIT: fixed 3 lines to 1 line when adding 0x80 at the beginning.