to generate valid links, turn
mega.nz/files/aaa#bbb
into
mega.nz/#!aaa!bbb