Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle unplayable content better with the local API #5922

Merged

Conversation

absidue
Copy link
Member

@absidue absidue commented Oct 23, 2024

Handle unplayable content better with the local API

Pull Request Type

  • Feature Implementation

Related issue

closes #3238

Description

This pull request introduces better handling for unplayable videos with the local API. As Invidious only returns the error message we cannot do anything like this for the Invidious backend, the same goes for private videos because YouTube only returns the please log-in message for those.

Currently when you encounter an unplayable video in FreeTube the watch page just breaks, this pull request changes that for members-only and age-restricted videos as well as when the user is IP blocked and has backend fallback disabled, by parsing as much metadata as possible so that the only missing information is the video player itself. For the IP blocked case, that required falling back to information from the /next response as the /player response is missing a lot of information when the IP block error is returned.

As age-restricted videos and member-only videos require a YouTube account, this pull request intentionally doesn't attempt to fallback to Invidious for those videos, as they will fail with Invidious too.

Screenshots

Members-only video

members-only

Age-restricted video

age-restricted

Age-restricted movie trailer

age-restricted-trailer

IP blocked with backend fallback disabled

ip-block

Testing

Make sure you are using the local API.

If you have access to a blocked IP address you can also test that the error message is shown instead of the player when backend fallback is disabled and that it still falls back to the Invidious API when backend fallback is enabled.

Regression test, as the trailer handling code changed:

  • Movie trailer: https://youtu.be/3HMXp2_-_es (searched for "Blade Runner 2049", if that movie isn't available in your region try searching for other ones)

Desktop

  • OS: Windows
  • OS Version: 10
  • FreeTube version: b1839a2

@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 23, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) October 23, 2024 12:15
@absidue absidue added the DO NOT MERGE UNTIL AFTER RELEASE Do not merge before the next release as this is not a bug fix label Oct 23, 2024
Copy link
Member

Choose a reason for hiding this comment

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

pre-approval

@ChunkyProgrammer ChunkyProgrammer removed the DO NOT MERGE UNTIL AFTER RELEASE Do not merge before the next release as this is not a bug fix label Oct 27, 2024
@FreeTubeBot FreeTubeBot merged commit fbef37d into FreeTubeApp:development Oct 27, 2024
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Oct 27, 2024
@absidue absidue deleted the better-unplayable-handling branch October 27, 2024 09:18
Soham456 pushed a commit to Soham456/FreeTube that referenced this pull request Dec 5, 2024
SuperAKWA pushed a commit to SuperAKWA/FreeTube that referenced this pull request Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Better error handling needed for unplayable content
5 participants