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

Fixed "get_throttling_function_name: could not find match for multiple" and other improvements #94

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

felipeucelli
Copy link
Contributor

Fixed "get_throttling_function_name: could not find match for multiple" #93

Recently YouTube updated its base.js and broke our regex that found the throttling function.

Example of the old structure:

a.C && (b = a.get("n")) && (b = Bpa[0](b), a.set("n", b)

New structure::

a.D && (b = String.fromCharCode(110), c = a.get(b)) && (c = IRa[0](c), a.set(b,c), IRa.length || Ima(""))

YouTube also added String.prototype.split.call to the throttling function.

This PR updates the regex to match the new structure and adds a command block in jsinterp.py to interpret "String.prototype.split.call".

Other improvements

YouTube also removed the use of API keys in its requests, so we updated the innertube structure.

@Deslakator
Copy link

Just change chipper.py and it's works for me, thanks for your PR

@felipeucelli
Copy link
Contributor Author

felipeucelli commented Jul 10, 2024

YouTube, in addition to changing the regex, also changed the structure of the throttling function, so just updating cipher.py will only fix clients that do not require decryption.

Just change cipher and run for example:

yt_url = 'https://www.youtube.com/watch?v=60ItHLz5WEA'
yt = YouTube(yt_url, 'WEB')

for y in yt.streams:
    print(f'{y} : {y.url}')

And you will have:

pytubefix.jsinterp.JSInterpreter.Exception: Unsupported String method prototype.split.call in: String.prototype.split.call(a,"")

@JuanBindez JuanBindez merged commit 73aadb0 into JuanBindez:dev Jul 10, 2024
JuanBindez added a commit that referenced this pull request Jul 10, 2024
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.

3 participants