-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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] Back-port JS interpreter upgrade from yt-dlp PR #1437 #30188
Conversation
There is probably some things that are not handled correctly in my implementation. It works well enough for the n-sig decryption, hence why I committed it. But you may want to review the whole thing |
Thanks. What I thought, but good to go anyway. You've obviously hit the things (comma-expressions, etc) that the previous version failed on for the n-sig. One question is whitespace. I guess just keep adding things into the unit test until it breaks ... |
@dirkf do you have a branch that has all your fixes/backports cumulatively ? i need to stick with py2-compatible youtube-dl too. |
I guess I should but I'm not looking forward to the endless conflict resolutions. |
how's that? do most fixes touch upon the same code locations ? |
This comment has been minimized.
This comment has been minimized.
Note there was another fix applied recently to support a recent player update: yt-dlp/yt-dlp@a1fc7ca |
Add yt-dlp/yt-dlp@a1fc7ca Thanks coletdjnz
Needed for new youtube js player f1ca6900 Add yt-dlp/yt-dlp@57dbe80#diff-729b57caa8d006426f6a8960c061f519a8b6658682284015e069745af52ffb07
a3aaca9
to
cabfef7
Compare
Could this PR provide compiled file, like this PR does? |
At a minimum |
yt-dlp/yt-dlp/@06dfe0a, improve _MATCHING_PARENS
Closed by revised #30184. |
Please follow the guide below
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:
What is the purpose of your pull request?
Description of your pull request and other information
As part of the PR "[youtube] Fix throttling by decrypting n-sig", @pukkandan implemented a more capable version of the JS interpreter module. Although it's not needed for the equivalent fix in yt-dl, having the same level of capability in yt-dl would facilitate other back-ports, eg in case a more complex YouTube challenge should have to be decoded in future. It might also suffice for certain other extractors where some JS trickery needs to be emulated.
This PR back-ports the
jsinterp.py
from yt-dlp/yt-dlp#1437 with changes to make it run in 2.6 <= Python < 3.6 as well.yield from
becomes nested iteratornonlocal
faked by a dummy namespace classcollections.abc
withcompat_collections_abc
added tocompat.py
.All the tests in the unchanged back-ported
test/test_jsinterp.py
pass.The
diff
below applies to the initial commit 7109df0.diff yt_dlp/jsinterp.py youtube_dl/jsinterp.py