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

[Feature Request] Implement JavaScript interpreter (or find a better dependency than PhantomJS) #923

Closed
2 tasks done
sulyi opened this issue Sep 8, 2021 · 10 comments
Closed
2 tasks done
Labels
duplicate This issue or pull request already exists

Comments

@sulyi
Copy link
Contributor

sulyi commented Sep 8, 2021

Checklist

  • I'm reporting a feature request
  • I've searched the bugtracker for similar feature requests including closed ones

Description

Implementing a JavaScript interpreter based on ECMA-262, 12th edition, ECMAScript® 2021 Language Specification.

@sulyi
Copy link
Contributor Author

sulyi commented Sep 8, 2021

I still have the codebase of ytdl-org/youtube-dl#11272, but I'm happy to start from scratch. I'm very excited by the prospect of collaboration @fstirlitz has shown.

@Ashish0804 Ashish0804 added the help-wanted Extra attention is needed label Sep 14, 2021
@sulyi
Copy link
Contributor Author

sulyi commented Sep 14, 2021

Originally I started to implement Standard ECMA 5.1.
Lexer uses regular expressions and have a close to complete grammar. A missing feature is handling white characters.
Parser is able to generate AST, but missing features like hoisting, semicolon insertion.
Interpreter is already able to execute several expressions including unary, binary, bit-wise and logical operators. Missing i.g. method call, built-ins, conditional and loop statements, just that I'm able to recall.

I've already got overwhelmed once. I'm looking for help, someone who can and willing to work on this.

@ghost
Copy link

ghost commented Sep 26, 2021

I might be interested in this. I have made an interpreter for a different language before.

@pukkandan pukkandan changed the title [Feature Request] Resume work on JavaScript interpreter [Feature Request] Implement JavaScript interpreter (or find a better dependency than PhantomJS) Oct 20, 2021
@sulyi
Copy link
Contributor Author

sulyi commented Apr 22, 2022

DOA

@sulyi sulyi closed this as completed Apr 22, 2022
@sheerluck
Copy link
Contributor

What about https://duktape.org

@sheerluck
Copy link
Contributor

phantomjs-bin Total size : 64.9 MiB
duktape Total size : 1.5 MiB

@sulyi
Copy link
Contributor Author

sulyi commented Jul 16, 2022

duktap is written in C and published under MIT license, but it's maintained.
Making a python wrapper for it could work.

@sulyi sulyi reopened this Jul 16, 2022
@Lesmiscore
Copy link
Contributor

It doesn't have DOM though? I think iqiyi requires DOM as well as interpreter to work

@MinePlayersPE
Copy link
Contributor

plus the only other usage of PhantomJS is to bypass PornHub's browser verification, so we'd need to implement browser APIs anyways

@pukkandan
Copy link
Member

Don't keep closing and reopening this. I originally marked #1354 as a dup of this, but now that is the main thread because you closed this!

@pukkandan pukkandan closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2022
@yt-dlp yt-dlp locked as resolved and limited conversation to collaborators Aug 28, 2022
@pukkandan pukkandan added duplicate This issue or pull request already exists and removed help-wanted Extra attention is needed labels Aug 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

6 participants