Skip to content

Random broken video from yt2009sabr.js #407

Description

@sh20000sh

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.

Activity

  1. ftde0 commented on Jun 26, 2026

    @ftde0
    Owner

    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?

  2. sh20000sh commented on Jun 27, 2026

    @sh20000sh
    Author

    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_uxc around its 35 min point but it won't help much I think.

  3. sh20000sh commented on Jun 27, 2026

    @sh20000sh
    Author

    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.

  4. sh20000sh commented on Jun 28, 2026

    @sh20000sh
    Author

    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.

  5. ftde0 commented on Jun 28, 2026

    @ftde0
    Owner

    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?

  6. sh20000sh commented on Jul 3, 2026

    @sh20000sh
    Author

    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.

  7. ftde0 commented on Jul 5, 2026

    @ftde0
    Owner

    wait, just to clarify, we're talking about sabr downloading or sabr playback directly in the browser (without downloads)?

  8. sh20000sh commented on Jul 7, 2026

    @sh20000sh
    Author

    Ah yes. I was talking about downloader. Not about direct playback.

  9. ftde0 commented on Jul 8, 2026

    @ftde0
    Owner

    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

  10. sh20000sh commented on Jul 11, 2026

    @sh20000sh
    Author

    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.

  11. ftde0 commented on Jul 11, 2026

    @ftde0
    Owner

    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

  12. sh20000sh commented on Jul 11, 2026

    @sh20000sh
    Author

    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 ps
    
  13. ftde0 commented on Jul 12, 2026

    @ftde0
    Owner

    yeah, 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

  14. sh20000sh commented on Jul 12, 2026

    @sh20000sh
    Author

    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?

  15. 2 remaining items

  16. sh20000sh commented on Jul 12, 2026

    @sh20000sh
    Author

    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.

  17. ftde0 commented on Jul 16, 2026

    @ftde0
    Owner

    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

  18. sh20000sh commented on Jul 17, 2026

    @sh20000sh
    Author

    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...

  19. ftde0 commented on Jul 18, 2026

    @ftde0
    Owner

    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

  20. sh20000sh commented on Jul 19, 2026

    @sh20000sh
    Author

    I just replaced yt2009sabr.js from last commit in this time. Do this config affect another part of code?

  21. sh20000sh commented on Jul 19, 2026

    @sh20000sh
    Author

    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.

  22. sh20000sh commented on Jul 19, 2026

    @sh20000sh
    Author

    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 ps never seen since last commit.

  23. sh20000sh commented on Jul 19, 2026

    @sh20000sh
    Author

    This might be something YT messed up for this region and got fixed.

    Image

    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.

  24. sh20000sh commented on Jul 19, 2026

    @sh20000sh
    Author

    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 ps never 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.

  25. ftde0 commented on Jul 19, 2026

    @ftde0
    Owner

    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)

  26. sh20000sh commented on Jul 20, 2026

    @sh20000sh
    Author

    I think youtube changed how to slow down download speed, so if this is inactive for next two weeks, it can be just closed.

  27. sh20000sh commented on Aug 3, 2026

    @sh20000sh
    Author

    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.

  28. ftde0 commented on Aug 3, 2026

    @ftde0
    Owner

    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

  29. sh20000sh commented on Aug 3, 2026

    @sh20000sh
    Author

    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.

    New folder (2).zip

    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
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions