Peacock keys.json = https://paste.ubuntu.com/p/cPxqx4g3Jq/
As you can see key is on index 2 (index starts from 0)
before that there were 2 mpd urls.
So we start the range with 2 (therefore skipping 0 and 1 index which consists of mpd url).
for i in range(2, len(config)):
Amazon keys.json = https://paste.ubuntu.com/p/9smG93ZrzZ/
In amazon there was 1 extra mpd url after keys.
Key's location was at index 1 as 0 index was mpd_url.
We skipped last index using -1.
len(config) will give you total number of index values in keys.json file.
So if we subtract 1 from total, it removes the last extra mpd url.
for i in range(1, len(config)-1):
I hope you get the idea.
if this looks Complicated : Google Python Indexing , Python lists.
help https://www.imagemhost.com.br/image/2QspbJ