Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

fix: isolate ScrapeCreators transcript HTTP errors from pipeline failure tracking (#829) (#830)

SAI MOHANEESH5c4fe1ed1d3f
diff --git a/skills/last30days/scripts/lib/instagram.py b/skills/last30days/scripts/lib/instagram.py
index 8292df27..8a7216a6 100644
--- a/skills/last30days/scripts/lib/instagram.py
+++ b/skills/last30days/scripts/lib/instagram.py
@@ -415,13 +415,17 @@ def fetch_captions(
if not url:
continue
try:
- data = http.get(
- f"{SCRAPECREATORS_BASE}/v2/instagram/media/transcript",
- params={"url": url},
- headers=http.scrapecreators_headers(token),
- timeout=transcript_timeout,
- retries=1,
- )
+ # Isolate transcript fetch errors from the pipeline-level
+ # capture_failures() context so an individual reel's 400 doesn't
+ # poison the entire source outcome (#829).
+ with http.capture_failures() as _tf:
+ data = http.get(
+ f"{SCRAPECREATORS_BASE}/v2/instagram/media/transcript",
+ params={"url": url},
+ headers=http.scrapecreators_headers(token),
+ timeout=transcript_timeout,
+ retries=1,
+ )
transcripts = data.get("transcripts") or []
if transcripts and isinstance(transcripts, list):
transcript_text = " ".join(
diff --git a/skills/last30days/scripts/lib/tiktok.py b/skills/last30days/scripts/lib/tiktok.py
index ef4c9a76..36e03ac9 100644
--- a/skills/last30days/scripts/lib/tiktok.py
+++ b/skills/last30days/scripts/lib/tiktok.py
@@ -355,13 +355,17 @@ def fetch_captions(
if not url:
continue
try:
- data = http.get(
- f"{SCRAPECREATORS_BASE}/video/transcript",
- params={"url": url},
- headers=http.scrapecreators_headers(token),
- timeout=15,
- retries=1,
- )
+ # Isolate transcript fetch errors from the pipeline-level
+ # capture_failures() context so an individual video's 400
+ # doesn't poison the entire source outcome.
+ with http.capture_failures() as _tf:
+ data = http.get(
+ f"{SCRAPECREATORS_BASE}/video/transcript",
+ params={"url": url},
+ headers=http.scrapecreators_headers(token),
+ timeout=15,
+ retries=1,
+ )
transcript = data.get("transcript")
if transcript:
if isinstance(transcript, list):
diff --git a/skills/last30days/scripts/lib/youtube_yt.py b/skills/last30days/scripts/lib/youtube_yt.py
index 966d9f0c..fb633c0e 100644
--- a/skills/last30days/scripts/lib/youtube_yt.py
+++ b/skills/last30days/scripts/lib/youtube_yt.py
@@ -1349,13 +1349,16 @@ def _sc_fetch_transcript(video_id: str, token: str) -> Optional[str]:
"""
video_url = f"https://www.youtube.com/watch?v={video_id}"
try:
- data = http.get(
- f"{SCRAPECREATORS_YT_BASE}/video/transcript",
- params={"url": video_url},
- headers=http.scrapecreators_headers(token),
- timeout=30,
- retries=1,
- )
+ # Isolate SC transcript fetch errors from the pipeline-level
+ # capture_failures() context.
+ with http.capture_failures() as _tf:
+ data = http.get(
+ f"{SCRAPECREATORS_YT_BASE}/video/transcript",
+ params={"url": video_url},
+ headers=http.scrapecreators_headers(token),
+ timeout=30,
+ retries=1,
+ )
except Exception as exc:
_log(f"SC transcript error for {video_id}: {exc}")
return None