refactor torrent2magnet