Repository navigation
Random broken video from yt2009sabr.js #407
Description
Activity
try changing the video quality if that happens, or skip around 30 seconds and see if it plays normally again, any video+quality combination you can get this consistently on?
Usually watching with 720p. Skipping seems didn't work as I remember.
At first, I thought this was video-specific but completed video has small size and being not deleted by auto-maintain and making it looks like issue happening consistently.Last case I got was from
v=UfMyvDI_uxcaround its 35 min point but it won't help much I think.I thought this was video-specific but completed video has small size
Checking audio and video length before merging might work I guess? Such like if they are not match, make it download video again.
Random guess, it might be affected by certain time of day like guess from #287 did. I experienced two times in row from different point of same video, as I retried download right after it broken after like five minutes.
Sometimes video are just stopped from certain point and only audio is being played
how long for? if it's just a few seconds before audio stops as well, that would mean that sabr stops sending new segments for a specific time offset request (that is known to happen rarely).
just for the record, this does happen on other browsers as well, right? any errors in console?
how long for? if it's just a few seconds before audio stops as well, that would mean that sabr stops sending new segments for a specific time offset request (that is known to happen rarely).
As I saw, more than five minutes. When this happened, stored video in assets folder are also broken like that so I think checking other browser is not necessary. In most cases, delete that certain video and redownloading fixed this issue. Console show nothing in prod mode.
wait, just to clarify, we're talking about sabr downloading or sabr playback directly in the browser (without downloads)?
Ah yes. I was talking about downloader. Not about direct playback.
hm, as with #287 you mentioned, i can't replicate this issue on my end (probably region based again), i'll add a temporary config option next update to add more extensive logging for sabr downloader to see if there is a simple fix
Checking audio and video length before merging might work I guess? Such like if they are not match, make it download video again.
i'd rather not do that if possible for the obvious reason of having to redownload a file entirely
- added a commit that references this issue
on Jul 9, 2026 Tried that config, I saw one got deadlock around somewhere middle point (17:05 of 27:20 long video, needed to be interrupted to get thing back to working). What I experienced for this issue was not deadlock so not actually sure about this.
the config option is only meant to log more info and doesn't fix the issue, if you get broken files at a specified offset then please share the log from around the offset the breakage happens (+ a few more before and after) so i can try to do some changes
That deadlock seems not the case, just something messed up during log printing. I got actual issue now. Unfortunately, I found nothing special from that log. This broken around 2:35 of video and log around those were this:
[sabr] got response for offset 2:00 - 3 ps [sabr] got response for offset 2:05 - 4 ps [sabr] got response for offset 2:10 - 3 ps [sabr] got response for offset 2:15 - 4 ps [sabr] got response for offset 2:20 - 3 ps [sabr] got response for offset 2:25 - 4 ps [sabr] got response for offset 2:30 - 3 ps [sabr] got response for offset 2:35 - 3 ps [sabr] got response for offset 2:40 - 1 ps [sabr] got response for offset 2:45 - 2 ps [sabr] got response for offset 2:50 - 2 ps [sabr] got response for offset 2:55 - 2 ps [sabr] got response for offset 3:00 - 1 psyeah, nothing standing out for me either here, can you reproduce the same deadlocks/issues on flash sabr? it also requests offsets like that so the issue should show here if it's network related
This thing happens randomly and happen like once on more than a day, so I'm not sure I'm going to try it. As I saw, main point of issue was processed video on instance so direct playback won't replicate those exact issue. It would even play from middle of video so worst case would be just five sec long pause if it even happens.
After seeing that log, I think this happens on next step of downloading. Are there any possibilities that those bytes declare end of video unintentionally?
2 remaining items
wait, it happens on regular youtube for you as well?
Sometimes happened as I remember. I think youtube set low threshold because of "network usage fee" policy around here.
hm, still weird that the responses are seemingly valid but then not, best i guess i can do is to add even more log for the config in the next update so this can be tracked down further
Something reminds me from those numbers, when I saw videos from Youtube, player's default quality was usually 720p, but after few minutes, it falls to 360p after few minutes of playback even if my network environment was fine.
When this happened by the way, I used to set quality back to 720p manually, then it won't fall automatically, but it would load with slow loading speed. It became quite long time ago I watch regular Youtube for normal use now...
- added a commit that references this issue
on Jul 18, 2026 then it won't fall automatically, but it would load with slow loading speed.
probably you re-selecting got around the part that would have normally broken, i'm keeping this open in hopes that this can be finally fixed but this does look to be a network/region issue that i'm not facing
c0b7470 with the same config option will save raw sabr responses for the offsets, if you get breaking again please send the response files for 2-3 parts before the broken timestamp, the part closest and 2-3 after
I just replaced
yt2009sabr.jsfrom last commit in this time. Do this config affect another part of code?And this actually didn't happened since I post log here a week ago. This might be something YT messed up for this region and got fixed.
Looked at those log bit while, can it be downloading single part for certain offset which not located at end of video be indicator of this issue? Log that saying
1 psnever seen since last commit.This might be something YT messed up for this region and got fixed.
Downloading being stopped for while happened sometimes, but due to bug, it still got response for audio only, or something like that. You know, #287 was happening from those absence too.
Looked at those log bit while, can it be downloading single part for certain offset which not located at end of video be indicator of this issue? Log that saying
1 psnever seen since last commit.If this is case, marking offset around those points to not delete would be enough, rather than keeping all parts. If I couldn't get case until next update.
Just tested video that would have small size per length, like video playing single frequency with still image, it had at least 2 parts for single offset.
towards the end of the video you may see 1 part (ps = parts), if you're unlucky enough or you switch qualities in-between you may even get 0 parts in a response (then they contain a redirect you must follow to get the rest of the video)
I think youtube changed how to slow down download speed, so if this is inactive for next two weeks, it can be just closed.
I just saw a case today, after three weeks from last one. I disabled that debug mode due to space managing issue during that happening. Maybe once in weeks is something just can be ignored rather than once in days, like I first reported.
What I'm thinking about from that log once showed up, it looks like youtube gives response when this happens, but only sending audio, not video.
next update will force an older client version to (temporarily) get non-sabr downloads back anyway
What I'm thinking about from that log once showed up, it looks like youtube gives response when this happens, but only sending audio, not video.
in most cases the video part should come in the next/previous request, idk at this point
I can provide example finally. I wanted to talk about deadlock but when I tried to copy log with Ctrl+C, it just continued and that log in question happened right after it. And video also broken right at that point.
saving raw response for 1:23:25 as dsabr-raw-ytowch3njdv79053-5005000 [sabr] got response for offset 1:23:25 - 3 ps saving raw response for 1:23:30 as dsabr-raw-ytowch3njdv79053-5010000 [sabr] got response for offset 1:23:30 - 4 ps saving raw response for 1:23:35 as dsabr-raw-ytowch3njdv79053-5015000 [sabr] got response for offset 1:23:35 - 3 ps saving raw response for 1:23:40 as dsabr-raw-ytowch3njdv79053-5020000 [sabr] got response for offset 1:23:40 - 4 ps saving raw response for 1:23:45 as dsabr-raw-ytowch3njdv79053-5025000 [sabr] got response for offset 1:23:45 - 2 ps saving raw response for 1:23:50 as dsabr-raw-ytowch3njdv79053-5030000 [sabr] got response for offset 1:23:50 - 2 ps saving raw response for 1:23:55 as dsabr-raw-ytowch3njdv79053-5035000 [sabr] got response for offset 1:23:55 - 1 ps saving raw response for 1:24:00 as dsabr-raw-ytowch3njdv79053-5040000 [sabr] got response for offset 1:24:00 - 2 ps saving raw response for 1:24:05 as dsabr-raw-ytowch3njdv79053-5045000 [sabr] got response for offset 1:24:05 - 1 ps saving raw response for 1:24:10 as dsabr-raw-ytowch3njdv79053-5050000 [sabr] got response for offset 1:24:10 - 2 ps saving raw response for 1:24:15 as dsabr-raw-ytowch3njdv79053-5055000 [sabr] got response for offset 1:24:15 - 2 ps saving raw response for 1:24:20 as dsabr-raw-ytowch3njdv79053-5060000 [sabr] got response for offset 1:24:20 - 4 ps saving raw response for 1:24:25 as dsabr-raw-ytowch3njdv79053-5065000 [sabr] got response for offset 1:24:25 - 4 ps saving raw response for 1:24:30 as dsabr-raw-ytowch3njdv79053-5070000 [sabr] got response for offset 1:24:30 - 5 ps saving raw response for 1:24:35 as dsabr-raw-ytowch3njdv79053-5075000 [sabr] got response for offset 1:24:35 - 3 ps saving raw response for 1:24:40 as dsabr-raw-ytowch3njdv79053-5080000
It usually happened from longer(like hours) videos with probability with not just to be ignored. Sometimes video are just stopped from certain point and only audio is being played. Tried to play video in question on instance locally, those are processed like that. Tried to download same video it became playable so it isn't video specific issue. I think some fragments cause later part of video corrupt for some reason.