Skip to content

feat: expose possibly_sensitive and media warning labels - #87

Open
ayanamists wants to merge 1 commit into
jackwener:mainfrom
ayanamists:feat/sensitive-media-fields
Open

ayanamists wants to merge 1 commit into
jackwener:mainfrom
ayanamists:feat/sensitive-media-fields

Conversation

@ayanamists

Copy link
Copy Markdown
Contributor

Why

GraphQL already sends legacy.possibly_sensitive and media labels (ext_sensitive_media_warning / sensitive_media_warning). The parser dropped them, so --json / --yaml clients 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_sensitive from legacy.possibly_sensitive
  • TweetMedia.adult_content / graphic_violence / other_warning from the media entity (including nested media_results.result)
  • structured output adds possiblySensitive on tweets and quoted tweets, plus adultContent, graphicViolence, otherWarning on each media item
  • additive only: existing keys are unchanged; new bools default to false

Tests

  • serialization roundtrip for the new fields
  • home timeline fixture with possibly_sensitive + ext_sensitive_media_warning
  • _extract_media nested sensitive_media_warning

Documented in SCHEMA.md.

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.
@c4nc

c4nc commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Hi Li — thanks for #87 (possibly_sensitive + media warning labels). One note on where things stand: X's Sept 2026 page rebuild broke the x-client-transaction-id header for everyone, so the repo can't ship anything until that's resolved. I opened the fix upstream as #93, and in the meantime I've made a maintained fork — c4nc/twitter-cli — that cherry-picks your #87 (plus #57 and #75/#76/#77) with explicit attribution in the README, so a working build exists. Your code is used unmodified and credited. If the original repo resumes, I'd rather be a contributor or maintainer there than keep the fork — happy to help either way.

This branch has not been deployed

No deployments
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.

2 participants