feat(facebook): name the age gate instead of blaming visibility - #17
Merged
Conversation
A reel can be public and still serve an anonymous visitor nothing, because Facebook restricts it to viewers over 18. Every such link ended at `facebookNoVideo`, whose text asks the reader to make sure the post is public -- the one thing that is already fine. They check it, find nothing wrong, and are left with no way forward. `facebookAgeRestricted` now carries that case, with its own English and Vietnamese wording that says the post's visibility is not the problem. The gate is recognised by the route Facebook names in the document, `CometAgeInappropriateLoggedOutErrorRoute`. The sentence a reader sees is drawn by script and never reaches the HTML, so matching the visible text would have found nothing. Measured before relying on it: the marker appears 16 times on an age-gated reel and not once on a public post, a watch page, or the logged-out home page. All three strategies report into the same flag rather than the last page tried deciding, since any of them may be the one that lands on the gate.
This was referenced Sep 1, 2026
Merged
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.
Follow-up to #16, which fixed the transport-level failure but left this case reporting the wrong reason.
The problem
A Facebook reel can be public and still serve an anonymous visitor nothing, because Facebook restricts it to viewers over 18. Every such link ended at
facebookNoVideo:So the reader goes and checks visibility, finds it is already public, and is left with nowhere to go. That is exactly how the original report played out.
The change
A new
facebookAgeRestrictedkind carries the case, with its own English and Vietnamese wording saying the post's visibility is not the problem.Detection keys on the route Facebook names in the document,
CometAgeInappropriateLoggedOutErrorRoute. The visible sentence is drawn by script and never reaches the HTML, so matching the text a reader sees would have found nothing — worth stating because it is the non-obvious part.Measured before relying on the marker:
/watch/?v=…All three extraction strategies report into one flag rather than letting the last page tried decide, since any of them may be the one that lands on the gate.
Verification
flutter test— 222 pass.extraction_failure_text_test.dartalready iteratesExtractionFailureKind.values, so the new kind is covered in both locales without a new test there.flutter analyze— No issues foundfacebook.com/share/r/1Bszhs9VD4/, run through the real extractor and the real network:Scope
This makes the failure honest; it does not make the video downloadable. Reaching age-gated media needs the viewer's own authenticated session, which would want
flutter_secure_storage— the project stores settings inshared_preferencestoday, and a session cookie does not belong there in plaintext. That remains an open decision, not part of this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01RjyfcAcWuaNcXTc4ZdTofM