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

Fix web throttling because of double deciphering #3759

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

absidue
Copy link
Member

@absidue absidue commented Jul 10, 2023

Fix web throttling because of double deciphering

Pull Request Type

  • Bugfix

Related issue

closes #3457
partially #3738 (will create a separate pull request for the comments)

Description

Finally figured out why DASH was getting throttled but audio only and the legacy formats were fine. Took multiple weeks and stabs in the dark but we finally solved it.

The cause was us deciphering the formats and overwriting the URL in the Format objects, to avoid having to decipher them in lots of places around FreeTube (e.g. downloads, audio only, legacy). Unfortunately when we generated the DASH manifest with toDash, YouTube.js deciphered the already deciphered formats again, causing the n-param to be correct everywhere but the DASH manifest.

I don't why we were completely fine without any throttling for months before that became an issue, all I can think is that YouTube made a change that resulted in the double deciphering becoming a problem.

As the web client is fine again, I'm removing the extra fetching of the android formats, so that we don't make excess requests. If we end up needing them again in the future, they can always be added back quite easily.

Thank you very much to @AudricV and @LuanRT for their help and putting up with me while we tried to figure out the issue! 🤗

Testing

Play videos on the local API without proxying with the DASH formats enabled. Additionally test some age restricted videos like this one mentioned in the issue https://youtu.be/rrSnnhe53ks or the videos in this playlist: https://www.youtube.com/playlist?list=PLze6c8Dxpjv4eaemhVXYLURZt3Pcrddw5

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 10, 2023
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) July 10, 2023 20:39
Copy link
Member

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@PikachuEXE PikachuEXE left a comment

Choose a reason for hiding this comment

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

Finally fixed!

@FreeTubeBot FreeTubeBot merged commit b0239d1 into FreeTubeApp:development Jul 11, 2023
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 11, 2023
@absidue absidue deleted the fix-web-throttling branch July 11, 2023 04:42
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.

[Bug]: Network download and buffering is significantly slower compared to browser
5 participants