youtube-dl/youtube_dl
Kevin O'Connor 4eda10499e
[utils] Don't attempt to coerce JS strings to numbers in js_to_json (#26851)
The current logic in `js_to_json` tries to rewrite octal/hex numbers to
decimal. However, when the logic actually happens the `"` or `'` have
already been trimmed off. This causes what were originally strings, that
happen to look like octal/hex numbers, to get rewritten to decimal and
returned as a number rather than a string.

In practive something like:

```js
{
  "0x40": "foo",
  "040": "bar",
}
```

would get rewritten as:

```json
{
  64: "foo",
  32: "bar
}
```

This is problematic since this isn't valid JSON as you cannot have
non-string keys.
2020-10-18 00:10:41 +07:00
..
downloader [downloader/http] Properly handle missing message in SSLError (closes #26646) 2020-09-22 07:01:59 +07:00
extractor [ustream] Add support for video.ibm.com (#26894) 2020-10-17 23:14:46 +07:00
postprocessor
__init__.py
__main__.py
aes.py
cache.py
compat.py
jsinterp.py
options.py
socks.py
swfinterp.py
update.py
utils.py [utils] Don't attempt to coerce JS strings to numbers in js_to_json (#26851) 2020-10-18 00:10:41 +07:00
version.py release 2020.09.20 2020-09-20 12:30:45 +07:00
YoutubeDL.py