Skip to content

Make sure description isn't null when extracting chapters from description #7505

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

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

ChunkyProgrammer
Copy link
Member

Pull Request Type

  • Bugfix

Related issue

closes #7503

Description

result.basic_info.short_description and result.secondary_info.description.text are both nullable strings and for whatever reason both returned null from Rune's testing

Testing

  • Go to https://youtu.be/A1IlubXQpL8
  • Don't receive error, TypeError: Cannot read properties of undefined (reading 'matchAll') (error is inconsistent so we must try multiple times)

Desktop

  • OS: Fedora Linux
  • OS Version: 42
  • FreeTube version: latest git commit

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 3, 2025 10:58
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jun 3, 2025
absidue
absidue previously requested changes Jun 3, 2025
Copy link
Member

@absidue absidue left a comment

Choose a reason for hiding this comment

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

Before we do a fix to just make the error go away, we should check that the description is actually completely missing in those responses or whether it has been moved to somewhere else in the response structure, in which case we should extract it from the new location. My suspicion is that it is the latter (yt-dlp has had reports recently about the translated title not being extracted, which sounds related) and an A/B test which would explain why it can't be reproduced consistently.

Unfortunately @efb4f5ff-1298-471a-8973-3d47447115dc wasn't able to reproduce it with the devtools attached, so we currently only have the error message (in electron/chromium logs are captured all the time, requests and responses are only captured while devtools are open).

I'm not blocking this pull request entirely, I just want to be sure that this is the right fix. If we don't have an answer right before we do the next release, I am happy to approve it as-is so that users don't see the error.

@efb4f5ff-1298-471a-8973-3d47447115dc

I've caught the error again and shared the responses

@ChunkyProgrammer
Copy link
Member Author

Looks like it has a placeholder (descriptionPlaceholder) saying that the description is empty now:

              {
                "expandableVideoDescriptionBodyRenderer": {
                  "descriptionPlaceholder": {
                    "content": "No description has been added to this video.",
                    "styleRuns": [
                      {
                        "startIndex": 0,
                        "fontColor": 4284506208,
                        "italic": true
                      }
                    ]
                  }
                }
              },

@absidue
Copy link
Member

absidue commented Jun 3, 2025

As it looks like the description is actually missing and it seems like YouTube is just switching how they handle videos without a description, I'll remove my block.

@absidue absidue self-requested a review June 3, 2025 21:07
@absidue absidue dismissed their stale review June 3, 2025 21:07

outdated

@efb4f5ff-1298-471a-8973-3d47447115dc

Got this message

VirtualBoxVM_yVQPBCMe6F

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: waiting for review For PRs that are complete, tested, and ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: TypeError: Cannot read properties of undefined (reading 'matchAll')
3 participants