Skip to content

feat(channels): add Facebook support#259

Open
harshitanand wants to merge 4 commits intoPanniantong:mainfrom
harshitanand:feat/issue-171-facebook-channel
Open

feat(channels): add Facebook support#259
harshitanand wants to merge 4 commits intoPanniantong:mainfrom
harshitanand:feat/issue-171-facebook-channel

Conversation

@harshitanand
Copy link
Copy Markdown

@harshitanand harshitanand commented Apr 10, 2026

What

Adds FacebookChannel using yt-dlp (public videos) and Jina Reader (text posts) as backends, following the existing channel pattern.

Changes

  • agent_reach/channels/facebook.py — handles facebook.com, fb.com, and fb.watch URLs; tier-0 (yt-dlp already a dependency); public videos via yt-dlp, text posts via Jina Reader
  • agent_reach/channels/__init__.py — registers FacebookChannel in ALL_CHANNELS
  • tests/test_channels.py — adds TestFacebookChannel with can_handle(), check() (yt-dlp present/absent), and registry assertions

Testing

  • TestFacebookChannel — can_handle (facebook.com, fb.com, fb.watch), check ok, check off, registry — PASSED
  • Follows existing channel contract (can_handle, check, name, description, backends, tier)

Related

Closes #171

@Panniantong
Copy link
Copy Markdown
Owner

Thanks for the PR! The channel skeleton is clean and follows project conventions well. However, there are a few issues that need to be addressed before we can merge:

1. Missing read() / search() implementation (Medium)
The PR description says "public videos via yt-dlp, text posts via Jina Reader", but the actual code only implements can_handle() and check(). There's no routing logic to distinguish videos from text posts, and no read(url) or search(query) methods. Please add at least a basic implementation, or stub them with NotImplementedError and a clear docstring explaining the plan.

2. check() should return "warn" when only yt-dlp is missing (Medium)
Currently check() returns "off" when yt-dlp isn't found. But Jina Reader (listed as a backend) requires no installation — so the channel is partially functional even without yt-dlp. Please change the logic:

  • yt-dlp present → "ok"
  • yt-dlp missing but Jina Reader available → "warn" (with message explaining video support requires yt-dlp)
  • Neither available → "off"

3. Missing m.facebook.com in can_handle() (Low)
Mobile Facebook URLs use m.facebook.com — please add it to the domain check.

Once these are addressed, we'll be happy to merge. Thanks!

Add FacebookChannel using yt-dlp (public videos) and Jina Reader
(text posts) as backends, following the existing channel pattern.

- Handles facebook.com, fb.com, and fb.watch URLs
- tier-0: yt-dlp is already a project dependency
- Registered in ALL_CHANNELS in channels/__init__.py
…ong#171)

- check() now returns 'warn' (not 'off') when yt-dlp missing; Jina Reader is
  always available so the channel is partially functional
- Add m.facebook.com to can_handle() for mobile URLs
- Add stub read() and search() with NotImplementedError and clear docstrings
- Update test: rename off→warn check, add m.facebook.com assertion
@harshitanand harshitanand force-pushed the feat/issue-171-facebook-channel branch from 6129c1b to 37e8d10 Compare April 21, 2026 23:19
@harshitanand
Copy link
Copy Markdown
Author

Thanks for the detailed review! Addressed all three points and rebased on latest main:

  1. read() / search() stubs added — both methods now raise NotImplementedError with clear docstrings explaining the routing plan (yt-dlp for videos, Jina Reader for text posts) and why search isn't available (no public Facebook search API).
  2. check() now returns "warn" when yt-dlp is missing — since Jina Reader requires no installation, the channel is partially functional. Logic: yt-dlp present → "ok", yt-dlp missing → "warn" with message explaining video support requires yt-dlp but text posts still work.
  3. m.facebook.com added to can_handle() — mobile Facebook URLs now handled correctly.

Tests updated to cover the new warn case and m.facebook.com. Force-pushed.

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.

可否添加访问Facebook帖子和评论区的功能?

2 participants