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

[Bug] Playback success statistics aren't being returned correctly on instances without proxy and/or DASH #4231

Open
syeopite opened this issue Nov 4, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@syeopite
Copy link
Member

syeopite commented Nov 4, 2023

Playback success statistics aren't being returned correctly on instances without proxy and/or DASH.

Here's the playback success stats for an instance with proxy and dash disabled:

"playback": {
    "totalRequests": 1,
    "successfulRequests": 0,
    "ratio": 0.0
}

Theoretically this should've just been an empty object as Invidious itself is not playing anything and as such there shouldn't be any data there. If I had to guess this is probably due to this line here

get_playback_statistic()["totalRequests"] += 1

Which appends the total requests when YouTube returns the wrong video during parsing. That line should probably be removed as its out of scope and can lead to instances being falsely accused of being blocked on /videoplayback.

Alternatively, we can just increment successfulRequests within the video parser as well.

@syeopite syeopite added the bug Something isn't working label Nov 4, 2023
@syeopite
Copy link
Member Author

syeopite commented Nov 5, 2023

We should probably also have a blockage status for YouTube returning the wrong video id as well. Maybe a separate parsing success rate statistics?

I'm personally still in favor of the job-based method in the original PR. The extra requests shouldn't contribute to blockage that much compared to the load that public instances typically get.

@absidue
Copy link
Contributor

absidue commented Nov 5, 2023

Returning the wrong video ID, is the Innertube APIs equivalent to the /videoplayback endpints returning 403s.
The wrong video is arguably worse than the 403s, because with the 403s you can at least still view the video without proxying, but with the wrong API response you can't do anything.

@unixfox
Copy link
Member

unixfox commented Nov 5, 2023

Playback stats was for me a way to tell that local proxy and DASH works.

If we start to include non proxy stuff this will false the statistics because this will always work as the traffic is not passing through instance.

But these statistics unfortunately do not work for people that started to use the outside component for proxying the videoplayback: https://docs.invidious.io/improve-public-instance/#3-speed-up-video-playback-with-http3-ytproxy

I don't know how to solve this issue?

Maybe we could move the playback success to another path and I can rewrite http3-ytproxy so that it also report the playback success. Then instance owners have to proxy just this path to the outside component for giving real statistics.
That could be a way to solve this issue.

@absidue
Copy link
Contributor

absidue commented Nov 6, 2023

Sounds you need to write a custom patch for your custom proxy, so it writes the stats to the invidious db.

@unixfox
Copy link
Member

unixfox commented Nov 6, 2023

Sounds you need to write a custom patch for your custom proxy, so it writes the stats to the invidious db.

That's 100% possible if we offer an alternative proxy that works for all the public instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants