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, YouTube] Support YT player b22ef6e7 etc #32845

Merged
merged 5 commits into from
Jul 10, 2024
Merged

Conversation

dirkf
Copy link
Contributor

@dirkf dirkf commented Jul 10, 2024

Boilerplate: own/yt-dlp code, fix/improvement

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 either this or the below have already 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 supports YT player b22ef6e7 (probably just in time for it to be withdrawn).

At the same time, the opportunity was taken to improve the alignment of the code and tests with yt-dlp.

Fixes #32842.
Supersedes, closes #32843.

Also included is a previously intended update to PR #32830.

Thx @Grub4K, @bashonly, @seproDev, @pukkandan and possibly others for yt-dlp code included here.

bashonly and others added 3 commits July 8, 2024 16:54
Adds some extensions missing in 4652109
(from yt-dlp/yt-dlp#10362)

Authored by: bashonly
Co-authored by: dirkf
@dirkf dirkf linked an issue Jul 10, 2024 that may be closed by this pull request
5 tasks
@jja
Copy link

jja commented Jul 10, 2024

👍 works for me, thanks!

if obj == compat_str:
# Fixup prototype call
if isinstance(obj, type):
new_member, rest = member.partition('.')[0::2]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not

Suggested change
new_member, rest = member.partition('.')[0::2]
new_member, _, rest = member.partition('.')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call me a slicer rather than a destructurer. Also that's what I had in my somewhat similar code before I applied yt-dlp/yt-dlp#10392.

youtube_dl/jsinterp.py Outdated Show resolved Hide resolved
youtube_dl/utils.py Show resolved Hide resolved
dirkf added a commit to dirkf/youtube-dl that referenced this pull request Jul 10, 2024
* support `prototype` for call() and apply() (yt-dlp/yt-dlp#10392, thx Grub4k)
* map JS `Array` to `list`
* improve extraction of function name (like yt-dlp/yt-dlp#10390)
* always use JSInterp to extract function code (yt-dlp/yt-dlp#10396, thx seproDev, pukkandan)
@dirkf dirkf merged commit 16f5bbc into ytdl-org:master Jul 10, 2024
14 checks passed
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] Unable to extract nsig jsi ...
4 participants