Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2018.07.04. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
Description of your issue, suggested solution and other information
As mentioned in PR #16317 by @dstftw
js_to_json()has a bug that is removing commas (,) at line endings when a}inside a line comment is following. I debugged this a bit and got to the following minimal reproducible example.Extracted JavaScript code from website:
Result after putting it into
js_to_json()(notice the space after0):When running it in a debugger, it turns out that
fix_kv()(the callback insidejs_to_json()) is receiving the,after0as a separate match and because of this condition it's removing the comma all together:I cannot fix this by myself because I'm not familiar enough with regex to make an adequate fix. I suspect that there should be a check added to see if the following
}(which is apparently interpreted as the termination of the dict) is inside a comment (or theskipgroup alltogether?).