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 proxying live DASH streams #4589

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

absidue
Copy link
Contributor

@absidue absidue commented Apr 21, 2024

The live DASH manifests returned by Invidious use .c.youtube.com subdomains, not the usual .googlevideo.com ones, YouTube's live DASH also uses numbered sequences/segments with the sq parameter instead of byte ranges.

This pull request updates the domain check in the proxy to also support the .c.youtube.com domains and prevents Invidious adding a range header when it is missing but the sq parameter is present.

@absidue absidue requested a review from a team as a code owner April 21, 2024 10:38
@absidue absidue requested review from SamantazFox and removed request for a team April 21, 2024 10:38
Comment on lines +40 to +41
sq = query_params["sq"]?
if range_header.nil? && sq.nil?
Copy link
Member

Choose a reason for hiding this comment

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

The Range header here is only added for the HEAD request below. After that, it's removed again. Does that change really make a difference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm odd, when I tested it without this change before it didn't work but I've just tested it again and now it worked without removing the range header too???

Personally I wouldn't send it, even if it doesn't make a difference, as YouTube's player would never send it for live stream segments either, but it's up to you to decide what the best approach is for Invidious.

Copy link
Member

Choose a reason for hiding this comment

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

I should try to get rid of that HEAD request at some point.
I really want to split the logic between DASH and progressive streams/download, but I don't know where to start, this code has always broke on me every time I tried to make significant changes...

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.

None yet

2 participants