There is a file ( url ) which dynamically updates the value of tokens with each update ( request ) and contains approximately the following inside:
[{ "_id": "someidlikewewsdw", "type": 1, "name": "Channelname1", "logo": "/static/logos/channellogo1.png", "thread": "https://somesite.com/Channelname1/video.m3u8?token=33121", "enabled": true }, { "_id": "someidlikewewesq", "type": 1, "name": "Channelname2", "logo": "/static/logos/channellogo2.png", "thread": "https://somesite.com/Channelname2/video.m3u8?token=13121", "enabled": true }, { "_id": "someidlikewewesd", "type": 1, "name": "Channelname3", "logo": "/static/logos/channellogo3.png", "thread": "https://somesite.com/Channelname3/video.m3u8?token=23121", "enabled": true }] I need to assign the value of "thread" to a variable. Let us create the variables Channel1token, Channel2token, Channel3token and assign them the values from theard each separately.
var Channel1token = https://somesite.com/Channelname1/video.m3u8?token=33121 and so on.
All this is needed in js so that the requests go from the client, since each client is assigned a separate token.