The token changes every day, so you should obtain it everyday again.
I am running this statement once a day on linux with a cronjob (on windows it is similar)
curl "https://api-web.ug-be.cdn.united.cloud/oauth/token?grant_type=client_credentials" -H "User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0" -H "Accept: application/json, text/plain, */*" -H "Accept-Language: nl,en-US;q=0.7,en;q=0.3" --compressed -H "Referer: https://epg.sbb.rs/503" -H "Authorization: Basic MjdlMTFmNWUtODhlMi00OGU0LWJkNDItOGUxNWFiYmM2NmY1OjEyejJzMXJ3bXdhZmsxMGNkdzl0cjloOWFjYjZwdjJoZDhscXZ0aGc=" -H "Content-Type: application/x-www-form-urlencoded" -H "Origin: https://epg.sbb.rs" -H "Connection: keep-alive" --data "" -o /volume1/web/sbb.rs
As you see there is a mistake on the github (which I corrected now)
At the end of the above statement you can see: -o /volume1/web/sbb.rs
-o denotes the output of the curl statement.
/volume1/web/ is the folder of my webserver.
and sbb.rs is the token filename (was telemach.ba - which is the sister website for which I originally wrote the procedure)
curl is then retrieving the token and writing it in /volume1/web/sbb.rs
Edited by doglover, 17 August 2020 - 09:45.