[utils] Improve js_to_json, align with yt-dlp
authordirkf <fieldhouse@gmx.net>
Wed, 3 May 2023 11:06:34 +0000 (12:06 +0100)
committerdirkf <fieldhouse@gmx.net>
Wed, 19 Jul 2023 21:14:50 +0000 (22:14 +0100)
commitd9d07a95815a992bf5f876a62f25c831eb3f32ac
treed02660f9072ecdf5b5e8b6a9cc7b52d27915a407
parent825a40744bf9aeb743452db24e43d3eb61feb6c2
[utils] Improve js_to_json, align with yt-dlp
* support variable substitution, from https://github.com/yt-dlp/yt-dlp/pull/#521 etc,
  thanks ChillingPepper, Grub4k, pukkandan
* improve escape handling, from https://github.com/yt-dlp/yt-dlp/pull/#521
  thanks Grub4k
* support template strings from https://github.com/yt-dlp/yt-dlp/pull/6623
  thanks Grub4k
* add limited `!` evaluation (eg, !!0 -> false, see tests)
test/test_utils.py
youtube_dl/utils.py