Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsinterp] Improve JS language support #31175

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

dirkf
Copy link
Contributor

@dirkf dirkf commented Aug 17, 2022

Boilerplate: mixed code, improvement/bug fix ## Please follow the guide below
  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

Before submitting a pull request make sure you have:

In order to be accepted and merged into youtube-dl each piece of code must be in public domain or released under Unlicense. Check one of the following options:

  • I am the original author of this code and I am willing to release it under Unlicense, except for code from yt-dlp for which this or the below has been asserted
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

Description of your pull request and other information

This PR continues the upgrade of the mini JS interpreter and also addresses new syntax served in player c81bbb4a served by YouTube.

The PR adds support for:

* operator ??
* operator ?.
* operator **
* accurate operator functions
* `undefined` handling
* object literals {a: 1, "b": expr}
@dirkf dirkf merged commit b0a60ce into ytdl-org:master Aug 17, 2022
github-actions bot added a commit to hellopony/youtube-dl that referenced this pull request Aug 17, 2022
pukkandan added a commit to yt-dlp/yt-dlp that referenced this pull request Aug 18, 2022
gaming-hacker added a commit to gaming-hacker/youtube-dl that referenced this pull request Aug 26, 2022
* commit 'ed5c44e7b74ac77f87ca5ed6cb5e964a0c6a0678':
  [compat] Replace deficient ChainMap class in Py3.3 and earlier * fix version check
  [compat] Replace deficient ChainMap class in Py3.3 and earlier
  [jsinterp] Improve try/catch/finally support
  [jsinterp] Fix bug in operator precedence * from yt-dlp/yt-dlp@164b03c * added tests
  [YouTube] Improve error check for n-sig processing
  [core] Avoid processing empty format list after removing bad formats * also ensure compat encoding of error strings
  [utils] Ensure RFC3986 encoding result is unicode
  [infoq] Avoid crash if the page has no `mp3Form`
  [uktvplay] Support domain without .uktv
  [jsinterp] Clean up and pull yt-dlp style * add compat_re_Pattern * improve compat_collections_chain_map * use class JS_Undefined * remove unused code
  [jsinterp] Handle regexp literals and throw/catch execution (ytdl-org#31182)
  [jsinterp] Improve JS language support (ytdl-org#31175)
belamenso pushed a commit to belamenso/youtube-dl that referenced this pull request Sep 19, 2022
* operator ??
* operator ?.
* operator **
* accurate operator functions
* `undefined` handling
* object literals {a: 1, "b": expr}
* more tests for weird JS comparisons: see ytdl-org#31173 (comment).
gaming-hacker added a commit to gaming-hacker/youtube-dl that referenced this pull request Oct 6, 2022
* commit 'b6bfdb25f200ba63ba1b011a54431cb424be46e9': (23 commits)
  [jsinterp] Workaround operator associativity issue * temporary fix for player 5a3b6271 [1]
  [cache] Add cache validation by program version, based on yt-dlp
  [jsinterp] Handle new YT players 113ca41c, c57c113c * add NaN * allow any white-space character for `after_op` * align with yt-dlp f26af78 (charcodeAt and bitwise overflow) * allow escaping in regex, fixing player c57c113c
  [options] Document that postprocessing is not forced by --postprocessor-args
  [compat] Replace deficient ChainMap class in Py3.3 and earlier * fix version check
  [compat] Replace deficient ChainMap class in Py3.3 and earlier
  [jsinterp] Improve try/catch/finally support
  [jsinterp] Fix bug in operator precedence * from yt-dlp/yt-dlp@164b03c * added tests
  [YouTube] Improve error check for n-sig processing
  [core] Avoid processing empty format list after removing bad formats * also ensure compat encoding of error strings
  [utils] Ensure RFC3986 encoding result is unicode
  [infoq] Avoid crash if the page has no `mp3Form`
  [uktvplay] Support domain without .uktv
  [jsinterp] Clean up and pull yt-dlp style * add compat_re_Pattern * improve compat_collections_chain_map * use class JS_Undefined * remove unused code
  [jsinterp] Handle regexp literals and throw/catch execution (ytdl-org#31182)
  [jsinterp] Improve JS language support (ytdl-org#31175)
  [postprocessor] Don't replace existing value with null metadata parsed from title
  [jsinterp] Overhaul JSInterp to handle new YT players 4c3f79c5, 324f67b9 (ytdl-org#31170)
  [core] Make `--max-downloads ...` stop immediately on reaching the limit
  [test, etc] Improve download test logs; also clean up some new flake8 issues (ytdl-org#31153)
  ...
gaming-hacker added a commit to gaming-hacker/youtube-dl that referenced this pull request Oct 19, 2022
* commit '2c0c42cd5c5689eed3dba0c16399c7b3386b44b9': (394 commits)
  cleaning
  Improvements
  Improvement: Readme
  Fix Crucial guide command leads into errors
  [jsinterp] Workaround operator associativity issue * temporary fix for player 5a3b6271 [1]
  [cache] Add cache validation by program version, based on yt-dlp
  [jsinterp] Handle new YT players 113ca41c, c57c113c * add NaN * allow any white-space character for `after_op` * align with yt-dlp f26af78 (charcodeAt and bitwise overflow) * allow escaping in regex, fixing player c57c113c
  [options] Document that postprocessing is not forced by --postprocessor-args
  [compat] Replace deficient ChainMap class in Py3.3 and earlier * fix version check
  [compat] Replace deficient ChainMap class in Py3.3 and earlier
  [jsinterp] Improve try/catch/finally support
  [jsinterp] Fix bug in operator precedence * from yt-dlp/yt-dlp@164b03c * added tests
  [YouTube] Improve error check for n-sig processing
  [core] Avoid processing empty format list after removing bad formats * also ensure compat encoding of error strings
  [utils] Ensure RFC3986 encoding result is unicode
  [infoq] Avoid crash if the page has no `mp3Form`
  [uktvplay] Support domain without .uktv
  [jsinterp] Clean up and pull yt-dlp style * add compat_re_Pattern * improve compat_collections_chain_map * use class JS_Undefined * remove unused code
  [jsinterp] Handle regexp literals and throw/catch execution (ytdl-org#31182)
  [jsinterp] Improve JS language support (ytdl-org#31175)
  ...
alxlive pushed a commit to alxlive/youtube-dl that referenced this pull request Feb 27, 2023
* operator ??
* operator ?.
* operator **
* accurate operator functions
* `undefined` handling
* object literals {a: 1, "b": expr}
* more tests for weird JS comparisons: see ytdl-org#31173 (comment).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[YouTube] TypeError: '>' not supported between instances of 'int' and 'NoneType'
1 participant