This site has an engine to convert fanfic posted to a wide range of archive sites into epub and other formats. Seems to make reasonably good epubs so far.
https://www.flagfic.com/ It doesn't currently support the archives, but it might be worth asking them if it can be done.