Commit graph

7576 commits

Author SHA1 Message Date
CREDO23
9793751b44 docs(tiktok): trim stage 2 comment to the why 2026-07-10 17:28:47 +02:00
CREDO23
f74a73efdb docs(tiktok): trim fetch_item_list retry docstring to intent 2026-07-10 17:28:47 +02:00
CREDO23
01bc3f8de3 docs(config): trim narration from xvfb + listing-retry comments 2026-07-10 17:28:47 +02:00
CREDO23
97e250be4b docs(env): document TIKTOK_LISTING_MAX_ATTEMPTS 2026-07-10 17:25:48 +02:00
CREDO23
8f825b7b3c test(tiktok): cover item_list retry-on-empty loop 2026-07-10 17:25:48 +02:00
CREDO23
c8fcf87685 fix(tiktok): retry empty item_list captures on a fresh exit IP
The profile feed is withheld from flagged IPs and the proxy rotates per request, so re-fetching an empty capture (up to TIKTOK_LISTING_MAX_ATTEMPTS) turns a bad first draw into a hit instead of an ErrorItem.
2026-07-10 17:25:48 +02:00
CREDO23
15fb50c83e feat(tiktok): add TIKTOK_LISTING_MAX_ATTEMPTS knob
Bounds the browser-listing retry-on-empty; default 3, set 1 for a static IP.
2026-07-10 17:25:48 +02:00
CREDO23
493579913e docs(tiktok): note stage 2 profile feed is headful only when flag is set 2026-07-10 17:17:53 +02:00
CREDO23
c29b7f4b6b docs(env): document CRAWL_HEADED_XVFB_ENABLED 2026-07-10 17:17:53 +02:00
CREDO23
d3a6e2cd45 docs(docker): note entrypoint wires xvfb at runtime
The xvfb runtime path is now implemented, so drop the stale 'deferred to Slice B' note.
2026-07-10 17:17:53 +02:00
CREDO23
6400dc5f04 fix(tiktok): gate headful profile feed on CRAWL_HEADED_XVFB_ENABLED
fetch_item_list goes headful only when the flag promises a display; otherwise it stays headless so the browser launch never fails and the empty feed degrades to an ErrorItem. Verified under xvfb-run: real videos returned on a clean proxy IP, graceful degrade on a flagged one.
2026-07-10 17:17:45 +02:00
CREDO23
a551dd7553 feat(docker): start Xvfb when CRAWL_HEADED_XVFB_ENABLED is set
For every browser-running role (api/worker/all, not migrate) the entrypoint brings up a virtual display and exports DISPLAY, registering Xvfb for graceful shutdown. Off keeps browsers headless.
2026-07-10 17:17:36 +02:00
CREDO23
6784503414 feat(crawl): add CRAWL_HEADED_XVFB_ENABLED flag
Single switch promising an Xvfb display so the stealth browser can run headful (TikTok's profile feed is empty to headless Chromium). Defaults FALSE.
2026-07-10 17:17:27 +02:00
CREDO23
44966315f1 docs(tiktok): update e2e stage 2 notes for headful profile feed
Profile videos now return via the headful item_list capture; reword the
stage 2 comments to expect real videos, ErrorItem only as fallback.
2026-07-10 16:45:53 +02:00
CREDO23
c679f2a3ef fix(tiktok): fetch profile video lists headful + dismiss login modal
The profile feed (/api/post/item_list) returns an empty 200 to headless
sessions but serves data headful on the same proxy IP. Run fetch_item_list
headful and dismiss the login modal that blocks mid-scroll.
2026-07-10 16:45:45 +02:00
moduvoice
d3d8f10940 feat(i18n): add Korean (ko) translation
Adds a complete Korean locale (surfsense_web/messages/ko.json) with full
key parity with en.json, and wires ko into every place locales are
currently enumerated: next-intl routing config, the client-side locale
context/loader, and the two language-switcher UIs (main app + sidebar
user profile).
2026-07-10 11:22:54 +07:00
Anish Sarkar
abb2ea2d3b feat(auth-utils): add Instagram to public route prefixes for monitoring 2026-07-10 09:24:06 +05:30
Anish Sarkar
2a6715e2a3 feat(homepage): update hero section description and add Instagram use case
Enhanced the hero section by including Instagram in the list of platforms monitored by SurfSense. Additionally, introduced a new use case for "Social sentiment mining" that details the capabilities of pulling public posts and analyzing audience reactions on Instagram.
2026-07-10 09:23:53 +05:30
CREDO23
867e940911 Merge upstream/dev into feature/tiktok-scraper
Sync with the advanced dev tip so the PR compares against current dev
(drops already-merged commits from the diff). No history rewritten.
2026-07-09 20:15:20 +02:00
CREDO23
bcfc3a5c3a test(capabilities): expect export_run in the agent tool manifest
The run-reader set gained export_run (CSV export of a stored run), but this
manifest assertion still expected only read_run/search_run. Add export_run so
the agent-door test reflects the shipped readers.
2026-07-09 20:04:30 +02:00
CREDO23
6b15d610d9 feat(tiktok): surface comments, user_search, trending across all product surfaces
Brings the three newer verbs to parity with tiktok.scrape everywhere it was
wired: MCP tools (+ selfcheck manifest), the chat subagent prompt/description,
the playground catalog, the native docs page, and the SEO marketing page. Also
adds live e2e stages for comments, user search, and trending. Docs/FAQ now
state the real contract: profile metadata is reliable while its video list can
be withheld, and keyword video search is walled (use user search for accounts).
2026-07-09 19:09:00 +02:00
CREDO23
67b5472b9f feat(tiktok): add tiktok.trending verb for the Explore feed
The Explore feed (/api/explore/item_list) is a global trending-video feed
served to anonymous sessions, and it returns the same itemStruct shape as the
other listings — so the verb reuses parse_video, the listing flow, the
TikTokVideoItem output, and the per-video billing meter wholesale. Adds a
browser-capture marker + fetch_trending, a synthetic-target orchestrator entry,
and the tiktok.trending capability, surfaced on the chat subagent.
2026-07-09 18:52:56 +02:00
CREDO23
7723b5b8b6 feat(tiktok): add tiktok.comments verb for public comment scraping
Comments load over a signed /api/comment/list XHR that TikTok serves to
anonymous sessions once the comments panel is opened (unlike profile-video and
general-search feeds), so this is a reliable verb. Given video URLs it returns
CommentItems (text, author, likes, reply counts; replies carry repliesToId),
deduped per video, capped, and degraded to an ErrorItem for empty/withheld
videos or a bad_url ErrorItem for non-video inputs.

Generalizes the browser capture over a pluggable interaction step so the
comments flow (open panel, scroll the panel to paginate) reuses the same
warm+capture scaffolding as listing/user-search. Billed per comment on a new
TIKTOK_COMMENT meter (TIKTOK_MICROS_PER_COMMENT, matching the per-comment
market), surfaced on the chat subagent alongside tiktok.scrape/user_search.
2026-07-09 18:35:26 +02:00
CREDO23
192b6dc31a feat(tiktok): add tiktok.user_search verb for account discovery
Video/general search is login-walled for anonymous sessions, but the Users
tab (/api/search/user) returns public account records without a redirect, so
this exposes the one reliably-unblocked search path. A keyword yields
TikTokProfileItems (name, followers, bio, verification), deduped per query,
capped, and degraded to an ErrorItem when a query is empty/withheld.

Reuses the browser capture (generalized over XHR markers + extractor) and the
shared profile item shape. Billed per account on a new TIKTOK_USER meter
(TIKTOK_MICROS_PER_USER), surfaced on the chat subagent alongside tiktok.scrape.
2026-07-09 18:00:40 +02:00
CREDO23
6652efd035 feat(tiktok): return profile metadata even when video listing is gated
A profile's account data (name, followers, bio, verification) lives in the
page's rehydration blob and loads over plain HTTP without a signed request,
so emit it first and always. The video listing needs a signed item_list XHR
that TikTok withholds from anonymous sessions, so it stays best-effort and
degrades to an ErrorItem. A blocked profile now yields its metadata instead
of only an ErrorItem.
2026-07-09 17:48:19 +02:00
Anish Sarkar
2c251f9e07 test(instagram): add tests for anonymous profile and hashtag discovery
Introduced new tests to validate the behavior of the Instagram scraper when discovering anonymous profiles and handling hashtag searches. The tests ensure that profile lookups succeed without requiring authentication, while hashtag searches correctly raise an error when access is blocked, enhancing the robustness of the scraper's functionality.
2026-07-09 20:26:18 +05:30
Anish Sarkar
82f1d0b4e5 refactor(instagram): improve anonymous scraping logic and error messaging
Enhanced the Instagram scraper to clarify the requirements for accessing user profiles and hashtags. Updated the error message for blocked access to provide detailed guidance on necessary credentials. Introduced a regex for validating Instagram usernames and refined the discovery function to handle profile queries directly, improving user experience and error handling in anonymous mode.
2026-07-09 20:23:09 +05:30
Anish Sarkar
f66ab73044 refactor(instagram): improve handling of login-gated endpoints in fetch logic
Enhanced the fetch_json function to immediately raise InstagramAccessBlockedError for login-gated endpoints, preventing unnecessary IP rotations. Introduced a new constant for authentication-walled paths to streamline the detection of access blocks, improving the scraper's efficiency in handling Instagram's restrictions.
2026-07-09 20:22:46 +05:30
Anish Sarkar
0309e1d28a refactor(instagram): streamline login redirect handling in tests
Revised tests for handling login redirects to improve clarity and efficiency. The test for immediate failure on endpoint-level walls was updated to prevent unnecessary IP rotations. Additionally, new tests were added to ensure that partial results are returned when encountering blocked targets, enhancing the resilience of the scraper's batch processing.
2026-07-09 19:56:55 +05:30
Anish Sarkar
a0b388a5c5 refactor(instagram): enhance batch processing for access block handling
Updated the fan_out function to allow partial results when encountering blocked targets. Instead of aborting the entire batch on a hard login wall, the function now tracks blocked statuses and raises InstagramAccessBlockedError only if all targets are blocked. This change improves the scraper's resilience and efficiency in handling Instagram's access restrictions.
2026-07-09 19:56:41 +05:30
Anish Sarkar
be26f00d20 refactor(instagram): enhance fetch logic for login wall detection
Updated the fetch_json function to raise InstagramAccessBlockedError immediately upon detecting a login redirect (302 -> /accounts/login/). This change prevents unnecessary IP rotations when encountering endpoint-level access blocks, improving the efficiency of the scraper's handling of Instagram's login wall.
2026-07-09 19:56:29 +05:30
Anish Sarkar
4af0b9dbbd test(instagram): add regression test for InstagramAccessBlockedError handling
Introduced a new test to ensure that InstagramAccessBlockedError is properly propagated without causing deadlocks in the scraper's fan_out function. This regression test verifies that the error surfaces correctly when a blocked job is encountered, enhancing the resilience of the fetch process.
2026-07-09 19:09:06 +05:30
Anish Sarkar
e8f8eeab27 fix(instagram): improve error handling for Instagram access blocks in scraper
Updated the fan_out function to handle InstagramAccessBlockedError more gracefully. Instead of raising the error directly, it now puts the error into the results queue to prevent deadlocks. This change ensures that the consumer can handle access block scenarios without interrupting the processing of other jobs.
2026-07-09 19:08:18 +05:30
Anish Sarkar
5551ebbda7 chore(instagram): modify instagram svg 2026-07-09 19:08:00 +05:30
Anish Sarkar
6384409b1d test(instagram): enhance fetch resilience tests for login redirects
Added tests to handle scenarios where a 200 status response is redirected to a login page, ensuring proper rotation of IPs and raising errors when persistent login redirects occur. Updated the _FakeSession class to support login wall detection.
2026-07-09 18:29:29 +05:30
Anish Sarkar
d800ca33a5 feat(instagram): handle soft login wall in fetch logic
Added detection for Instagram's soft login wall, which returns a 200 status with login HTML. Implemented a new function to identify login redirects and adjusted the fetch logic to treat these cases similarly to 401/403 responses.
2026-07-09 18:29:17 +05:30
Anish Sarkar
ba83d16cba docs(web): add Instagram to MCP server tool docs 2026-07-09 16:07:50 +05:30
Anish Sarkar
f5aad487ac docs(web): document Instagram native connector 2026-07-09 16:07:42 +05:30
Anish Sarkar
4e86710b26 feat(web): cross-link Instagram from sibling connectors 2026-07-09 16:07:34 +05:30
Anish Sarkar
fa2ac406f3 feat(web): add Instagram connector marketing page 2026-07-09 16:07:19 +05:30
Anish Sarkar
d00030d97c feat(web): add Instagram playground platform and brand icon 2026-07-09 16:03:34 +05:30
Anish Sarkar
7309ca5ca0 test(instagram): add manual e2e scraper script 2026-07-09 16:03:29 +05:30
Anish Sarkar
e151346fbe test(chat): include Instagram in subagent composition test 2026-07-09 16:03:23 +05:30
Anish Sarkar
458d223ef8 test(billing): cover Instagram item and comment billing 2026-07-09 16:02:54 +05:30
Anish Sarkar
2e66e714e2 test(instagram): add capability unit tests 2026-07-09 16:02:48 +05:30
Anish Sarkar
9da136070d test(instagram): add platform-layer unit tests 2026-07-09 16:02:41 +05:30
Anish Sarkar
98eab8c4b5 feat(chat): add Instagram builtin subagent 2026-07-09 16:02:05 +05:30
Anish Sarkar
c5e3fd4006 feat(mcp): add Instagram scrape/comments/details tools 2026-07-09 16:01:55 +05:30
Anish Sarkar
929efe8152 feat(instagram): register instagram.* capability namespace 2026-07-09 16:01:49 +05:30
Anish Sarkar
7ea474be93 feat(instagram): add details capability verb 2026-07-09 16:01:38 +05:30