Skip to content

Add ability to know if a comment is edited and implement it for YouTube#1513

Merged
TobiGr merged 3 commits into
TeamNewPipe:devfrom
unleashedme:dev
Jun 13, 2026
Merged

Add ability to know if a comment is edited and implement it for YouTube#1513
TobiGr merged 3 commits into
TeamNewPipe:devfrom
unleashedme:dev

Conversation

@unleashedme

Copy link
Copy Markdown
Contributor

Description

This PR adds the ability to extract the edited status of YouTube comments to support UI indicators in the main app.

  • Added an isEdited() boolean to CommentsInfoItem.
  • Updated the extraction logic to evaluate the published time payload to determine if the comment has been modified.
  • This is the required backend implementation to resolve TeamNewPipe/NewPipe#13209.

Checklist

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

@TobiGr

TobiGr commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Thank you. Please fix the checkstyle errors (https://github.com/TeamNewPipe/NewPipeExtractor/actions/runs/27422345289/job/81074807973?pr=1513#step:6:65) and add corresponding tests to YoutubeCommentsExtractorTest.java. Our docs explain how to record mock files.

@unleashedme

Copy link
Copy Markdown
Contributor Author

While running the test suite, I noticed that testGetCommentsFormatting() in YoutubeCommentsExtractorTest.java is currently failing. It looks like the test is brittle because it assumes the formatted comment will always be at get(0) for the video https://www.youtube.com/watch?v=zYpyS2HaZHM, and the live comment section has shifted. And it is causing my build and test to fail.

@TobiGr TobiGr added enhancement New feature or request YouTube Service, https://www.youtube.com/ labels Jun 13, 2026
@sonarqubecloud

Copy link
Copy Markdown

@TobiGr TobiGr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you. The failing tests are unrelated. i have squashed your commits and added a formatting fix.

@TobiGr
TobiGr merged commit a79e606 into TeamNewPipe:dev Jun 13, 2026
2 of 3 checks passed

@AudricV AudricV left a comment

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.

Just some nitpicking to be done at some point, we need to support this feature on other services too.

}
}

assertTrue(hasEditedComment, "No comments is edited on this video. "+"Ensure test video has edited comment near the top.");

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.

Suggested change
assertTrue(hasEditedComment, "No comments is edited on this video. "+"Ensure test video has edited comment near the top.");
assertTrue(hasEditedComment, "No comments is edited on this video. Ensure test video has edited comment near the top.");

} catch (final Exception e) {
addError(e);
}

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.

Suggested change

@AudricV AudricV changed the title Added isEdited state extraction to CommentsInfoItem Add ability to know if a comment is edited and extract it for YouTube Jun 15, 2026
@AudricV AudricV changed the title Add ability to know if a comment is edited and extract it for YouTube Add ability to know if a comment is edited and implement it for YouTube Jun 15, 2026
@unleashedme

Copy link
Copy Markdown
Contributor Author

@AudricV Thanks for catching that. Since this is already merged, I will open a minor cleanup PR shortly to address these formatting nits.

}
return false;
} catch (final Exception e) {
return false;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the issue is here: a ParsingException should be thrown

@phillipecoutintho26-debug

This comment has been minimized.

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

Labels

enhancement New feature or request YouTube Service, https://www.youtube.com/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

See comment title "edited"

4 participants