invidious icon indicating copy to clipboard operation
invidious copied to clipboard

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

Open syeopite opened this issue 2 years ago • 6 comments

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

https://github.com/iv-org/invidious/blob/438467f69a20007cace4f300d03138b7d2d7e79a/src/invidious/videos/parser.cr#L84

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 avatar Nov 04 '23 20:11 syeopite

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.

absidue avatar Nov 05 '23 09:11 absidue

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.

unixfox avatar Nov 05 '23 09:11 unixfox

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.

syeopite avatar Nov 05 '23 09:11 syeopite

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

absidue avatar Nov 06 '23 09:11 absidue

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.

unixfox avatar Nov 06 '23 10:11 unixfox

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[bot] avatar Nov 05 '25 12:11 github-actions[bot]