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

Player makes range requests, YouTube responds with incorrect content lengths #750

Closed
TheAssassin opened this issue Sep 12, 2019 · 11 comments
Labels
bug Something isn't working stale

Comments

@TheAssassin
Copy link

As mentioned over at TeamNewPipe/NewPipe#2615 (comment), I discovered an issue with a few selective videos on YouTube which I tried to play back on invidious. I couldn't recall the exact URLs I used back then, but after looking a bit, I found one that is broken.

On https://invidio.us/watch?v=ppuKO2W9D_8, the following log is produced:

screenshot_2019-09-12_15-25-22

My initial assumption that YouTube was trying to be annoying here seems to be unsubstantiated, since the DASH playback version (&quality=dash, which by the way should IMO be the default) works just fine.

I couldn't find any other broken videos any more, nor could I find out why this is occurring, it just seems to me that YouTube has an issue on this one specific video that is unrelated to invidious. Nevertheless, as @omarroth invited me to post it here, I wanted to do so. Please let me know if you need any further information. Might as well be one of my privacy plugins, I can't tell for sure (they're all the same on all computers). I can try on some other setup later, I plan to test some stuff in some live ISO VM environments where there's vanilla browsers.

@omarroth omarroth added the bug Something isn't working label Sep 12, 2019
@omarroth
Copy link
Contributor

This has since been reported by a couple other folks as well. Testing a broken URL with curl returned an empty response body (with the incorrect Content-Length), so this appears to be/have been a bug in YouTube's backend, rather than anything browser-specific.

I wouldn't be surprised if TeamNewPipe/NewPipe#2623 also fixed this issue. Unfortunately I'm having trouble getting a new link to test with, so I expect this is likely resolved.

@omarroth
Copy link
Contributor

My mistake, I can still reproduce this on some videos. YouTube appears to only be returning the first chunk in this case (which normally includes metadata/initialization info).

It may be an issue that the video is still being processed, although I'm able to reproduce it on videos that are week+ old. 🤷‍♂️

@TheAssassin
Copy link
Author

What's the reason not to use MPEG-DASH by default? It yields a much better quality anyway, and the player can adapt to the network more easily.

@omarroth
Copy link
Contributor

See #616. The main reason is because streams need to be proxied, which puts more load on the instance.

@TheAssassin
Copy link
Author

Interesting. Not sure why proxying would be needed, NewPipe doesn't proxy either. But I guess you have your reasons.

@omarroth
Copy link
Contributor

There's some more info in this comment as well. Browsers enforce CORS which means it isn't possible to work with streams from YouTube directly, at least for the APIs needed to combine audio+video.

youtube-dl, FreeTube, NewPipe, etc. don't have to worry about this, since they have much more control over the requests they make.

@TheAssassin
Copy link
Author

Ah, I see. Was looking for a reason in the issues, but must've missed that comment. Makes perfect sense, and is really annoying.

Proxying is kind of dangerous, depending on the copyright laws this might be serving unauthorized copies...

I guess we finally need a desktop app built upon NewPipe(Extractor) or whatever backend that can handle CORS issues.

@omarroth
Copy link
Contributor

Testing a bit more, I'm only able to reproduce with files in format itag=22 (hd720, mp4). The URLs provided in #782 similarly appear to be in this format.

@github-actions
Copy link

github-actions bot commented Feb 2, 2021

This issue has been automatically marked as stale and will be closed in 30 days because it has not had recent activity and is much likely outdated. If you think this issue is still relevant and applicable, you just have to post a comment and it will be unmarked.

@github-actions github-actions bot added the stale label Feb 2, 2021
@github-actions github-actions bot closed this as completed Mar 4, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any activity in it in the last 30 days. If this is still applicable to the current version of Invidious feel free to open a new issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants