feat: expose possibly_sensitive and media warning labels - #87
Open
ayanamists wants to merge 1 commit into
Open
Conversation
Twitter GraphQL already returns legacy.possibly_sensitive and ext_sensitive_media_warning / sensitive_media_warning, but the parser dropped them. Frontends that inline photos need those flags to skip adult or graphic media. Preserve the labels on Tweet / TweetMedia and pass them through --json / --yaml as possiblySensitive, adultContent, graphicViolence, and otherWarning.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
GraphQL already sends
legacy.possibly_sensitiveand media labels (ext_sensitive_media_warning/sensitive_media_warning). The parser dropped them, so--json/--yamlclients that inline photos cannot tell adult or graphic media from anything else.This showed up while rendering timelines in Emacs: unmarked photos get inlined, including tweets Twitter already flagged.
What
Tweet.possibly_sensitivefromlegacy.possibly_sensitiveTweetMedia.adult_content/graphic_violence/other_warningfrom the media entity (including nestedmedia_results.result)possiblySensitiveon tweets and quoted tweets, plusadultContent,graphicViolence,otherWarningon each media itemfalseTests
possibly_sensitive+ext_sensitive_media_warning_extract_medianestedsensitive_media_warningDocumented in
SCHEMA.md.