playing magnet link

hi.
i want to build an addon that can play magnet links.
i dont care using other addons in order to play the magnet links.
how can i do that ?
i can build all the addon just dont know how to play the magnet.

thanks for your help.