{"id":50725845,"url":"https://github.com/helloruru/all-can-grab","last_synced_at":"2026-06-10T04:01:21.725Z","repository":{"id":344620863,"uuid":"1182462978","full_name":"HelloRuru/all-can-grab","owner":"HelloRuru","description":"萬用公開網頁擷取器 | Universal public web scraper with four-layer fallback strategy for AI agents","archived":false,"fork":false,"pushed_at":"2026-03-15T15:08:36.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-16T04:09:11.712Z","etag":null,"topics":["claude-code","facebook","notion","ptt","python","skill","web-scraper","youtube"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HelloRuru.png","metadata":{"files":{"readme":"README.ja.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-15T15:00:03.000Z","updated_at":"2026-03-15T15:08:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/HelloRuru/all-can-grab","commit_stats":null,"previous_names":["helloruru/all-can-grab"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/HelloRuru/all-can-grab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloRuru%2Fall-can-grab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloRuru%2Fall-can-grab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloRuru%2Fall-can-grab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloRuru%2Fall-can-grab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HelloRuru","download_url":"https://codeload.github.com/HelloRuru/all-can-grab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HelloRuru%2Fall-can-grab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34136112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","facebook","notion","ptt","python","skill","web-scraper","youtube"],"created_at":"2026-06-10T04:01:20.618Z","updated_at":"2026-06-10T04:01:21.705Z","avatar_url":"https://github.com/HelloRuru.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eAll Can Grab\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eリンクを貼ったら、AI が「アクセスできません」と返す？\u003c/strong\u003e\u003cbr\u003e\n  そのページ、実は公開されている。AI に鍵がないだけ。\u003cbr\u003e\n  このスクリプトが、その鍵束。\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-D4A5A5?style=flat-square\" alt=\"MIT License\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.8%2B-B8A9C9?style=flat-square\" alt=\"Python 3.8+\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/dependencies-minimal-A8B5A0?style=flat-square\" alt=\"Minimal Dependencies\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/claude_code-skill-E8B4B8?style=flat-square\" alt=\"Claude Code Skill\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"README.md\"\u003eEnglish\u003c/a\u003e \u0026nbsp;|\u0026nbsp; \u003ca href=\"README.zh-TW.md\"\u003e繁體中文\u003c/a\u003e \u0026nbsp;|\u0026nbsp; \u003cb\u003e日本語\u003c/b\u003e\n\u003c/p\u003e\n\n---\n\n## 課題\n\nFacebook のリンクを AI に貼った。\n\n返ってきたのは：*「すみません、このページにアクセスできません」*\n\n……その投稿、公開されてるのに。\n\n仕方なくブラウザを開いて、コピーして、貼り直す。毎回これ。\n\n正直、「コピペ」だけで一日の半分が消える。\n\nAI がやる気がないわけじゃない。プラットフォームごとに鍵が違うのに、合う鍵を持っていないだけ。\n\n## 解決策\n\nPython スクリプト1本。4層フォールバック。AI に正しい鍵を渡す。\n\n| 機能 | 説明 |\n|------|------|\n| スマート UA 切替 | Facebook/Threads は Googlebot UA、YouTube/GitHub は通常 UA |\n| TLS フィンガープリント回避 | curl_cffi で Cloudflare 保護サイト（Medium など）に対応 |\n| 有料 API フォールバック | Apify 連携、完全ロックされたプラットフォーム（Instagram など）用 |\n| ブラウザレンダリング | ヘッドレス Playwright、JavaScript が必要なページ用 |\n| 構造化出力 | 統一 JSON スキーマ、status・source・blocker フィールド付き |\n| 正直な報告 | 成功を偽らない——なぜ失敗したか、次に何をすべきか明確に報告 |\n\n## :package: インストール\n\n```bash\n# ステップ 1：コア依存パッケージをインストール\npip install requests beautifulsoup4\n\n# ステップ 2：オプションのフォールバックをインストール（多いほど取得範囲が広がる）\npip install curl_cffi                          # TLS フィンガープリント回避（Cloudflare）\npip install playwright \u0026\u0026 playwright install chromium  # ブラウザレンダリング\n\n# ステップ 3：試してみる\npython grab.py \"https://www.facebook.com/share/p/xxxxx/\"\n```\n\n## :brain: 仕組み\n\n4層戦略、速いものから順に：\n\n1. **素のHTTP**（HTTP request）——ブラウザを開かず、適切な User-Agent で直接 HTML を取得。ほとんどの公開ページはこれで十分。\n2. **TLS フィンガープリント**（curl_cffi）——実際のブラウザの TLS フィンガープリントを模倣。Cloudflare 保護（Medium など）に対応。\n3. **有料 API**（Apify）——プラットフォームが無料アクセスを完全にブロックした場合の最終手段（Instagram 単体投稿など）。\n4. **ブラウザレンダリング**（Playwright）——上記すべてが失敗した場合、ヘッドレスブラウザで JavaScript をレンダリング。\n\nログインなし。Cookie 保存なし。ログインウォール回避なし。公開コンテンツのみ。\n\n## :detective: プラットフォーム対応\n\n| プラットフォーム | 素の取得戦略 | フォールバック | ステータス | 備考 |\n|-----------------|-------------|---------------|-----------|------|\n| Facebook | Googlebot UA | Playwright | Tested | 公開投稿・ページ安定；OG URL 検証含む |\n| Threads | Googlebot UA | Playwright | Tested | |\n| YouTube | Normal UA | - | Tested | タイトルと説明のみ；動画コンテンツは未対応 |\n| GitHub | Normal UA | - | Tested | |\n| PTT | Normal UA + over18 cookie | Playwright | Tested | over18 cookie 自動設定 |\n| 104 Job Bank | Normal UA | - | Limited | 公開求人ページは取得可能；**プロフィール共有ページ（pda.104.com.tw）は Vue SPA で取得不可** |\n| Notion（公開ページ） | Googlebot UA | - | Tested | 公開 Notion ページは Googlebot に完全なコンテンツをレンダリング |\n| Astro / SSG サイト | Normal UA | - | Tested | サーバーレンダリング HTML、最も安定 |\n| LinkedIn | Googlebot UA | - | Not supported | 全メソッドで 999 エラー；取得可能なコンテンツなし |\n| Instagram | - | - | Partial | プロフィール（ユーザー名/フォロワー数）のみ；**単体投稿の無料手段なし** |\n| X / Twitter | Normal UA | Playwright | Limited | ログイン要求が増加中；公開ツイートも取得不保証 |\n| Medium | Normal UA | curl_cffi -\u003e Playwright | Limited | Cloudflare + SPA 二重防御 |\n| Dcard | Normal UA | Playwright | Limited | 一部投稿はログイン必要；匿名板はほぼロック |\n| その他 | Googlebot UA | Playwright | Best effort | |\n\n### ステータス定義\n\n- **Tested** ——安定動作、公開コンテンツはほぼ取得可能\n- **Partial** ——一部機能は動作するが、コア機能に制限あり\n- **Limited** ——プラットフォーム防御が厳しく、部分情報（タイトル・要約）は取得可能。失敗時は原因と提案を報告\n- **Not supported** ——プラットフォームが全スクレイピング手法を積極的にブロック；取得可能なコンテンツなし\n- **Best effort** ——専用戦略なし、汎用ロジックで最善を尽くす\n\n### アクセス不可能なプラットフォーム\n\n| プラットフォーム | 理由 |\n|-----------------|------|\n| LINE グループ / 投稿 | クローズドエコシステム、公開 URL なし |\n| 小紅書（RED） | クローズド + 地域制限 |\n| 有料コンテンツ | サブスクリプション必要；ペイウォール回避はしない |\n\n### Instagram 単体投稿（2026-03-13 時点）\n\n**無料で信頼できる手段なし。** Instagram は 2024 年末から未認証アクセスを完全ブロック。以下の方法はすべて失敗：Googlebot UA、通常/モバイル UA、`/embed/` エンドポイント、oEmbed API、未認証 Playwright、Google cache、IG 内部 API。\n\n| 代替手段 | 説明 | 費用 |\n|----------|------|------|\n| 手動確認 | ユーザー自身が IG にログインし、スクリーンショットやテキストを提供 | 無料 |\n| 公式埋め込み | Meta oEmbed で表示埋め込み可能（完全データ抽出は不可） | 無料 |\n| Apify 有料フォールバック | grab.py に内蔵；`APIFY_TOKEN` 設定で有効化 | 従量課金 |\n\n```bash\n# トークン設定時のみ IG 単体投稿で Apify を使用；未設定なら他の機能に影響なし\nexport APIFY_TOKEN=\"apify_api_xxxxx\"\n```\n\n## :open_file_folder: ファイル構成\n\n```text\nall-can-grab/\n  grab.py         # メインスクリプト\n  SKILL.md        # スキル説明（Claude Code 統合用）\n  README.md       # 英語版ドキュメント\n  README.zh-TW.md # 繁体字中国語ドキュメント\n  README.ja.md    # 日本語ドキュメント\n  LICENSE         # MIT\n```\n\n**Claude Code スキルとして：** `~/.claude/skills/learned/all-can-grab/` に配置すると、Claude Code が自動判断して使用。\n**スタンドアロン：** 任意のディレクトリで `python grab.py \u003cURL\u003e` を実行。\n\n## :wrench: カスタマイズ\n\n- **プラットフォーム追加**：`grab.py` のプラットフォーム設定に戦略エントリを追加\n- **カスタムパーサー**：`clinic_slots` フィールドがドメイン固有のパーサー追加方法を実演（歯科予約枠の例、コア機能ではない）\n- **環境変数**：`APIFY_TOKEN` を設定して Instagram 有料フォールバックを有効化\n\n## :bulb: なぜこう作ったか\n\n**ブラウザを開かなくていいなら、開かない。**\nHTTP で済むなら Playwright は不要。時間もリソースも節約。\n\n**サイトごとに鍵を分ける。**\nFacebook には Googlebot UA、PTT には over18 cookie。設定は1サイト1エントリ。追加は1行。\n\n**取れなかったら、正直に言う。**\n成功を偽らない。何が問題か、次に何をすべきか報告する。\n\n**公開コンテンツだけ。**\nログインなし。パスワード保存なし。ペイウォール回避なし。見えるものだけ取る。\n\n### 出力スキーマ\n\n```json\n{\n  \"summary\": \"3~5文の要約\",\n  \"items\": [\n    {\n      \"title\": \"投稿タイトル\",\n      \"snippet\": \"コンテンツ抜粋...\",\n      \"datetime_str\": \"2026-03-13\",\n      \"author\": \"著者名\",\n      \"url\": \"https://...\"\n    }\n  ],\n  \"clinic_slots\": [],\n  \"status\": \"success\",\n  \"blocker\": \"\",\n  \"raw_text\": \"完全な原文...\",\n  \"source\": \"http-googlebot\"\n}\n```\n\n| フィールド | 説明 |\n|-----------|------|\n| `status` | `success` / `partial` / `failed` |\n| `source` | 使用した戦略：`http-googlebot` / `http-normal` / `curl_cffi` / `playwright` |\n| `blocker` | 失敗原因（次のステップの判断用） |\n| `clinic_slots` | 拡張例：カスタムパーサーのデモ（コア機能ではない） |\n\n## 動作要件\n\n- Python 3.8+\n- `requests` + `beautifulsoup4`（必須）\n- `curl_cffi`（オプション——Cloudflare 回避）\n- `playwright`（オプション——ブラウザレンダリング）\n\n## ライセンス\n\n[MIT](LICENSE)\n\n---\n\n\u003cp align=\"center\"\u003e\n  ドアは開いた。取りに行こう。\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelloruru%2Fall-can-grab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelloruru%2Fall-can-grab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelloruru%2Fall-can-grab/lists"}