I have a PHP file that responds with a similar javascript response to below.
var count = 0;
var actors = [];
var directors = [];
var movies = ["7/n/n# L<DxJ", "7x/nx/nxlNTv", "(N/lN/lNUnNTv", "}x/Yx/YxL#llNTv", "}/Y/Y<L<J", "O/u;uiLY<J", "@/J/JNUL<DxJ"];
var hidden = [];
var r_space = null;
var chars = {
"i": "N",
"R": "6",
"u": "T",
"a": "i",
"V": "p",
">": "a"
};
for (var i in chars) {
if (i == ' ') r_space = asta[i];
}
The movie names are encoded using a simple algorithm using var chars. I want to iterate through the var movies and get all values in to an array so I can decode them.
What I have tried:
I tried using below code to split by ";" and then store it an array but the issues is some words in var movies also contain ";".
<pre lang="Python">var_array = str(response.content.decode()).split(";")[7][14:-1].split(",")
for va in var_array:
print(va[1:-1])
Is there a different way I can get all values in var movies to an array and then decode? Thanks.