Skip to content

Make SabrSchemePlugin more robust - #9753

Open
b2ag wants to merge 1 commit into
FreeTubeApp:developmentfrom
b2ag:b2ag-patch-9726
Open

Make SabrSchemePlugin more robust#9753
b2ag wants to merge 1 commit into
FreeTubeApp:developmentfrom
b2ag:b2ag-patch-9726

Conversation

@b2ag

@b2ag b2ag commented Sep 5, 2026

Copy link
Copy Markdown

Add guards for some rare situations causing video playback to hang.

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

closes #9726

Description

The changes are adding some guards for some rare situations causing video playback to hang. Should make SabrSchemePlugin more robust.

One point for discussion might be: what to do with an empty url on a redirect request? Just ignore the whole thing (what this change does)? Or skip setting the empty url but do shouldRetry = true so it retries the old url I guess (what v0.25.2 did)?

Testing

  1. Watch a lot of videos
  2. Check if video sometimes stops after some minutes with an endless spinner

Desktop

  • OS: NixOS
  • OS Version: unstable
  • FreeTube version: v0.25.3

@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Sep 5, 2026
@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) September 5, 2026 18:13

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the linter errors

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Sep 5, 2026
auto-merge was automatically disabled September 5, 2026 20:09

Head branch was pushed to by a user without write access

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) September 5, 2026 20:09
auto-merge was automatically disabled September 5, 2026 20:16

Head branch was pushed to by a user without write access

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) September 5, 2026 20:17
Added guards for some rare situations causing video playback to hang. closes FreeTubeApp#9726
auto-merge was automatically disabled September 5, 2026 20:22

Head branch was pushed to by a user without write access

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) September 5, 2026 20:22
@b2ag

b2ag commented Sep 5, 2026

Copy link
Copy Markdown
Author

Fixed it

@PikachuEXE

PikachuEXE commented Sep 5, 2026

Copy link
Copy Markdown
Member

Please provide some screenshots on the "some rare situations causing video playback to hang"
Hard to test on rare situations if they are really rare

Edit 1: Maybe some custom code for debug message should be added to a custom build to indicates the issue and the states and also confirm the fixes are "working" (new codes are run, via console messages and maybe also toasts)

@b2ag

b2ag commented Sep 5, 2026

Copy link
Copy Markdown
Author

Please provide some screenshots on the "some rare situations causing video playback to hang" Hard to test on rare situations if they are really rare

For screenshots look at the bug report issue #9726 .

Edit 1: Maybe some custom code for debug message should be added to a custom build to indicates the issue and the states and also confirm the fixes are "working" (new codes are run, via console messages and maybe also toasts)

I was thinking about that too. It would need to be at least a toast so I notice it. Console message will just drown in a see of messages and I'm not willing to check logs after every video I watch. I usually start a video in a new window and close that afterwards. So habit will make this hard for me.

I was thinking about automatically writing the log to the filesystem so I can grep for the prove later. If you want to help me with that or how to display a toast from thoses lines I touched, I would give it a try. I have no idea how I would do that.

But frankly speaking I'll just use this patch in my custom build and don't care that much about it going upstream. I just try to give something back here. It's also a quite small change which doesn't really change behavior for cases in which the data is well behaved. So if you are fine with not checking for e.g. an empty URL or "touching properties of undefined" and error-ing out with an endless spinner in that case, so be it.

@PikachuEXE

Copy link
Copy Markdown
Member

For debug messaging let me work on some code later (but probably not file writing coz it has to go through main process and takes too much effort as a debug

SABR is a blackbox so while the fix works for you we still want to see more details to understand more about it (the states causing the issues at least)

I will also include this after I added some debug code and see if I can reproduce them too

@PikachuEXE

PikachuEXE commented Sep 7, 2026

Copy link
Copy Markdown
Member

Got some debug code in https://github.com/PikachuEXE/FreeTube/tree/b2ag-patch-9726-debug
image

Feel free to add/edit as you like and run in your custom build and post screenshots of those debug messages
When you think it's good enough I can include it into my own custom build and see if I can reproduce it too

Update 1: (Left mediaHeader.isInitSeg one in there coz I forgot to remove which is only for testing, remove it if you don't like

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Video hangs mid playback, spinner shows, nothing happens. Invalid URL.

3 participants