mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-24 15:51:51 +00:00
Add playback success rate to /api/v1/stats (#4085)
* Add stats-based /videoplayback blockage status * Count when YouTube returns wrong video as failure * Cast playback stats hash type prior to return * Bump stats refresh timer to 10 minutes
This commit is contained in:
@@ -80,9 +80,14 @@ module Invidious::Routes::VideoPlayback
|
||||
# Remove the Range header added previously.
|
||||
headers.delete("Range") if range_header.nil?
|
||||
|
||||
playback_statistics = get_playback_statistic()
|
||||
playback_statistics["totalRequests"] += 1
|
||||
|
||||
if response.status_code >= 400
|
||||
env.response.content_type = "text/plain"
|
||||
haltf env, response.status_code
|
||||
else
|
||||
playback_statistics["successfulRequests"] += 1
|
||||
end
|
||||
|
||||
if url.includes? "&file=seg.ts"
|
||||
|
||||
Reference in New Issue
Block a user