Kodi addon with token generator

Hi im developing an addon to stream live tv but the problem is that the website that im trying to stream these servers works with token. So for example is this file : http://website.com/playlist.m3u8?__token__=ip=(an ip)~exp=(some numbers)~acl=*~hmac=(hmac adress)
So everytime i want to stream an m3u8 i need to do it manually to get the token from the website.
I want a code to get the token from the website and put it in the link of the m3u8 like this :
http://website.com/playlist.m3u8 + token from the website generator
This server works with akamai security to generate tokens i have the website where it generates the token but i want it to add automatically to the streaming file
Any solution ?
Thanks