{"id":48828672,"url":"https://github.com/yuuka-dev/xpostdeleter","last_synced_at":"2026-04-14T19:02:54.869Z","repository":{"id":342968262,"uuid":"1175799088","full_name":"yuuka-dev/XPostDeleter","owner":"yuuka-dev","description":"削除めんどうだよね？そのためのやつ","archived":false,"fork":false,"pushed_at":"2026-03-08T07:42:50.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-08T12:33:49.621Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yuuka-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08T07:21:08.000Z","updated_at":"2026-03-08T07:42:54.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/yuuka-dev/XPostDeleter","commit_stats":null,"previous_names":["yuuka-dev/xpostdeleter"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/yuuka-dev/XPostDeleter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuuka-dev%2FXPostDeleter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuuka-dev%2FXPostDeleter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuuka-dev%2FXPostDeleter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuuka-dev%2FXPostDeleter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yuuka-dev","download_url":"https://codeload.github.com/yuuka-dev/XPostDeleter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yuuka-dev%2FXPostDeleter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31810741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-04-14T19:02:40.485Z","updated_at":"2026-04-14T19:02:54.852Z","avatar_url":"https://github.com/yuuka-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XPostDeleter\n\n**[English](#english) | [Bahasa Indonesia](#bahasa-indonesia)**\n\n---\n\n\u003ca name=\"english\"\u003e\u003c/a\u003e\n## English\n\n### What is this?\n\nXPostDeleter scans your X (Twitter) archive and automatically deletes posts that contain **your face**, **NSFW content**, or **specific keywords** — your personal \"black history\" eraser.\n\n**How it works:**\n1. `archive_scanner.py` — reads your X archive, detects faces/NSFW with AI and/or scans text with LLM, outputs `delete_hit_list.csv`\n2. `delete_agent.py` — reads the CSV and deletes each post via Selenium with human-like mouse movement to avoid bot detection\n\n### Features\n\n- Face detection with [InsightFace](https://github.com/deepinsight/insightface) — matches your face against reference selfies\n- NSFW detection with [NudeNet](https://github.com/notAI-tech/NudeNet)\n- 3-stage text analysis (`--text`): keyword match → Gemini → Claude\n- Human-like mouse movement (Bézier curve + easing + jitter) to reduce bot detection risk\n- Checkpoint saving — progress is written to CSV after every deletion, safe to resume\n- RT (repost) handling — reposts are separated to `rt_hit_list.csv` and processed separately\n- Progress display with severity filtering\n\n### Requirements\n\n- Python 3.11+\n- Google Chrome + matching [ChromeDriver](https://googlechromelabs.github.io/chrome-for-testing/)\n- GPU recommended (CUDA) for InsightFace — CPU works but is slow\n- Gemini API key (free tier is sufficient) for text analysis\n\n### Setup\n\n#### 1. Clone \u0026 create virtual environment\n\n```bash\ngit clone https://github.com/yourname/XPostDeleter.git\ncd XPostDeleter\npython -m venv .venv\n\n# Windows\n.venv\\Scripts\\activate\n\n# macOS / Linux\nsource .venv/bin/activate\n```\n\n#### 2. Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n#### 3. Configure `.env`\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env`:\n\n```env\n# Chrome user data directory\nUSER_DATA_DIR=C:\\Users\\YourName\\AppData\\Local\\Google\\Chrome\\User Data\n\n# Required only for --text mode\nGEMINI_API_KEY=your_gemini_api_key_here\n\n# Optional — used for borderline cases escalated from Gemini\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n```\n\n#### 4. Add reference selfies\n\nPlace **2–5 clear selfies of yourself** in `reference_media/`. These are used by InsightFace to recognize your face in archive images.\n\n```\nreference_media/\n  selfie1.jpg\n  selfie2.jpg\n```\n\n\u003e `reference_media/` is in `.gitignore` — your photos will never be committed.\n\n#### 5. (Optional) Configure keywords for text analysis\n\n```bash\ncp keywords.json.example keywords.json\n```\n\nEdit `keywords.json` to add the words you want to detect in tweet text. Three severity tiers are supported:\n\n```json\n{\n  \"high\":   [\"word that must go\"],\n  \"medium\": [\"word that should go\"],\n  \"low\":    [\"word to consider\"]\n}\n```\n\n\u003e `keywords.json` is in `.gitignore` — your personal keyword list will never be committed.\n\n---\n\n### Step 1 — Prepare your X Archive\n\n1. Go to **X Settings → Your account → Download an archive of your data**\n2. Wait for the email, download and extract the zip\n3. Place the extracted folder as `XArchive/` in the project root:\n\n```\nXPostDeleter/\n  XArchive/\n    data/\n      tweets.js\n      tweets_media/\n        12345678-photo.jpg\n        ...\n```\n\n---\n\n### Step 2 — Generate the delete list\n\n#### Image / video scan only (default)\n\nDetects posts with your face or NSFW content:\n\n```bash\npython archive_scanner.py\n```\n\n\u003e If `delete_hit_list.csv` already exists, image/video analysis is automatically skipped — only new tweets are processed.\n\n#### Image + text analysis\n\nAlso scans all tweet text with keyword matching and LLM judgment:\n\n```bash\npython archive_scanner.py --text\n```\n\n**Text analysis pipeline (`--text`):**\n\n| Stage | Engine | When used |\n|-------|--------|-----------|\n| 1 — Keyword | local `keywords.json` | always (instant, free) |\n| 2 — Gemini | Gemini API (free tier) | tweets that pass keyword filter |\n| 3 — Claude | Claude API (optional) | tweets Gemini rates as uncertain |\n\n\u003e The Gemini free tier (15 RPM) is sufficient. A 10,000-tweet archive takes roughly 30 minutes for text analysis.\n\nThis creates (or updates) `delete_hit_list.csv`:\n\n| Column | Description |\n|--------|-------------|\n| `created_at` | Post timestamp |\n| `delete_url` | URL of the post |\n| `severity` | Risk score 0–5 |\n| `risk_tags` | e.g. `FACE_SELFIE`, `NSFW_HIGH`, `TEXT_KEYWORD`, `TEXT_GEMINI` |\n| `full_text` | Post text |\n| `hapus` | Deletion status (empty = pending, `sudah` = done) |\n\n**Always review the CSV and remove any rows you want to keep before proceeding.**\n\n---\n\n### Step 3 — Run the delete agent\n\n#### Option A — Attach to an already-running Chrome\n\n1. Close all Chrome windows, then launch Chrome with remote debugging:\n\n```powershell\n\u0026 \"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" `\n  --remote-debugging-port=9222 `\n  --user-data-dir=\"$env:USER_DATA_DIR\" `\n  --profile-directory=\"Default\"\n```\n\n2. Log in to X manually in that Chrome window.\n\n3. Run the agent:\n\n```bash\npython delete_agent.py --attach-existing --limit 50\n```\n\n#### Option B — Let Selenium launch Chrome automatically\n\n```bash\npython delete_agent.py --limit 50\n```\n\n#### Key options\n\n| Option | Default | Description |\n|--------|---------|-------------|\n| `--limit N` | 50 | Max posts to delete per run |\n| `--allow-low-severity` | off | Also delete severity \u003c 1 posts |\n| `--attach-existing` | off | Attach to running Chrome on port 9222 |\n| `--rt` | off | Process `rt_hit_list.csv` (unretweet mode) |\n| `--log-file PATH` | `xpostdeleter.log` | Log file path |\n| `--debug-rt` | off | Verbose RT/repost detection logging |\n\n---\n\n### Project structure\n\n```\nXPostDeleter/\n  delete_agent.py        # Entry point (CLI)\n  actions.py             # Delete / unretweet routines\n  browser.py             # ChromeDriver factory \u0026 navigation\n  human.py               # Human-like mouse, scroll, timing\n  utils.py               # Logging tee \u0026 progress bar\n  archive_scanner.py     # Archive scan → delete_hit_list.csv\n  image_analyzer.py      # Face recognition \u0026 NSFW detection\n  text_analyzer.py       # 3-stage text analysis (keyword / Gemini / Claude)\n  keywords.json.example  # Keyword list template (copy to keywords.json)\n  .env.example           # Environment variable template\n  requirements.txt       # Python dependencies\n```\n\n### Disclaimer\n\n\u003e **Read carefully before use.**\n\n- This tool is for **personal use only** — deleting your own posts.\n- Automated browser interaction may violate X's Terms of Service — **use at your own risk**.\n- During execution, **do not touch the mouse** (pyautogui controls it).\n- Keep batch sizes reasonable (20–50 per run) to reduce detection risk.\n- **AI detection (image, NSFW, and text) is not perfect.** False positives will occur — posts that have nothing to do with your intended targets may end up on the delete list. **Always review `delete_hit_list.csv` before running the delete agent.** The authors take no responsibility for any posts deleted as a result of false positives or misdetection.\n\n---\n---\n\n\u003ca name=\"bahasa-indonesia\"\u003e\u003c/a\u003e\n## Bahasa Indonesia\n\n### Apa ini?\n\nXPostDeleter memindai arsip X (Twitter) kamu dan secara otomatis menghapus postingan yang mengandung **wajahmu**, **konten NSFW**, atau **kata kunci tertentu** — penghapus \"jejak digital memalukan\" pribadimu.\n\n**Cara kerjanya:**\n1. `archive_scanner.py` — membaca arsip X, mendeteksi wajah/NSFW dengan AI dan/atau memindai teks dengan LLM, menghasilkan `delete_hit_list.csv`\n2. `delete_agent.py` — membaca CSV dan menghapus setiap postingan lewat Selenium dengan gerakan mouse seperti manusia untuk menghindari deteksi bot\n\n### Fitur\n\n- Deteksi wajah dengan [InsightFace](https://github.com/deepinsight/insightface) — mencocokkan wajahmu dengan foto referensi selfie\n- Deteksi NSFW dengan [NudeNet](https://github.com/notAI-tech/NudeNet)\n- Analisis teks 3 tahap (`--text`): pencocokan keyword → Gemini → Claude\n- Gerakan mouse seperti manusia (kurva Bézier + easing + jitter) untuk mengurangi risiko deteksi bot\n- Penyimpanan checkpoint — progres ditulis ke CSV setelah setiap penghapusan, aman untuk dilanjutkan\n- Penanganan RT (repost) — repost dipisah ke `rt_hit_list.csv` dan diproses terpisah\n- Tampilan progres dengan filter tingkat keparahan\n\n### Persyaratan\n\n- Python 3.11+\n- Google Chrome + [ChromeDriver](https://googlechromelabs.github.io/chrome-for-testing/) yang sesuai\n- GPU direkomendasikan (CUDA) untuk InsightFace — CPU bisa tapi lambat\n- Gemini API key (tier gratis sudah cukup) untuk analisis teks\n\n### Persiapan\n\n#### 1. Clone \u0026 buat virtual environment\n\n```bash\ngit clone https://github.com/yourname/XPostDeleter.git\ncd XPostDeleter\npython -m venv .venv\n\n# Windows\n.venv\\Scripts\\activate\n\n# macOS / Linux\nsource .venv/bin/activate\n```\n\n#### 2. Install dependensi\n\n```bash\npip install -r requirements.txt\n```\n\n#### 3. Konfigurasi `.env`\n\n```bash\ncp .env.example .env\n```\n\nEdit `.env`:\n\n```env\n# Direktori data pengguna Chrome\nUSER_DATA_DIR=C:\\Users\\NamaKamu\\AppData\\Local\\Google\\Chrome\\User Data\n\n# Wajib hanya untuk mode --text\nGEMINI_API_KEY=your_gemini_api_key_here\n\n# Opsional — digunakan untuk kasus meragukan yang dieskalasi dari Gemini\nANTHROPIC_API_KEY=your_anthropic_api_key_here\n```\n\n#### 4. Tambahkan foto selfie referensi\n\nTaruh **2–5 selfie yang jelas dari dirimu** di folder `reference_media/`. Ini digunakan InsightFace untuk mengenali wajahmu di foto-foto arsip.\n\n```\nreference_media/\n  selfie1.jpg\n  selfie2.jpg\n```\n\n\u003e `reference_media/` ada di `.gitignore` — foto-foto kamu tidak akan pernah ikut ter-commit.\n\n#### 5. (Opsional) Konfigurasi keyword untuk analisis teks\n\n```bash\ncp keywords.json.example keywords.json\n```\n\nEdit `keywords.json` untuk menambahkan kata-kata yang ingin kamu deteksi di teks tweet. Tersedia tiga tingkat keparahan:\n\n```json\n{\n  \"high\":   [\"kata yang harus dihapus\"],\n  \"medium\": [\"kata yang sebaiknya dihapus\"],\n  \"low\":    [\"kata yang perlu dipertimbangkan\"]\n}\n```\n\n\u003e `keywords.json` ada di `.gitignore` — daftar keyword pribadimu tidak akan pernah ikut ter-commit.\n\n---\n\n### Langkah 1 — Siapkan Arsip X\n\n1. Buka **X Settings → Your account → Download an archive of your data**\n2. Tunggu email, unduh dan ekstrak zip-nya\n3. Taruh folder hasil ekstrak sebagai `XArchive/` di root proyek:\n\n```\nXPostDeleter/\n  XArchive/\n    data/\n      tweets.js\n      tweets_media/\n        12345678-photo.jpg\n        ...\n```\n\n---\n\n### Langkah 2 — Buat daftar hapus\n\n#### Pindai gambar / video saja (default)\n\nMendeteksi postingan yang mengandung wajahmu atau konten NSFW:\n\n```bash\npython archive_scanner.py\n```\n\n\u003e Jika `delete_hit_list.csv` sudah ada, analisis gambar/video otomatis dilewati — hanya tweet baru yang diproses.\n\n#### Gambar + analisis teks\n\nJuga memindai seluruh teks tweet dengan pencocokan keyword dan penilaian LLM:\n\n```bash\npython archive_scanner.py --text\n```\n\n**Pipeline analisis teks (`--text`):**\n\n| Tahap | Engine | Kapan digunakan |\n|-------|--------|-----------------|\n| 1 — Keyword | `keywords.json` lokal | selalu (instan, gratis) |\n| 2 — Gemini | Gemini API (tier gratis) | tweet yang lolos filter keyword |\n| 3 — Claude | Claude API (opsional) | tweet yang dinilai meragukan oleh Gemini |\n\n\u003e Tier gratis Gemini (15 RPM) sudah cukup. Arsip 10.000 tweet membutuhkan sekitar 30 menit untuk analisis teks.\n\nIni akan membuat (atau memperbarui) `delete_hit_list.csv`:\n\n| Kolom | Keterangan |\n|-------|------------|\n| `created_at` | Waktu postingan |\n| `delete_url` | URL postingan |\n| `severity` | Skor risiko 0–5 |\n| `risk_tags` | misal `FACE_SELFIE`, `NSFW_HIGH`, `TEXT_KEYWORD`, `TEXT_GEMINI` |\n| `full_text` | Teks postingan |\n| `hapus` | Status penghapusan (kosong = belum, `sudah` = selesai) |\n\n**Selalu tinjau CSV dan hapus baris yang ingin kamu pertahankan sebelum melanjutkan.**\n\n---\n\n### Langkah 3 — Jalankan agen penghapus\n\n#### Opsi A — Menempel ke Chrome yang sudah berjalan\n\n1. Tutup semua jendela Chrome, lalu jalankan Chrome dengan remote debugging:\n\n```powershell\n\u0026 \"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" `\n  --remote-debugging-port=9222 `\n  --user-data-dir=\"$env:USER_DATA_DIR\" `\n  --profile-directory=\"Default\"\n```\n\n2. Login ke X secara manual di jendela Chrome tersebut.\n\n3. Jalankan agennya:\n\n```bash\npython delete_agent.py --attach-existing --limit 50\n```\n\n#### Opsi B — Biarkan Selenium menjalankan Chrome secara otomatis\n\n```bash\npython delete_agent.py --limit 50\n```\n\n#### Opsi-opsi utama\n\n| Opsi | Default | Keterangan |\n|------|---------|------------|\n| `--limit N` | 50 | Maksimal postingan yang dihapus per run |\n| `--allow-low-severity` | mati | Juga hapus postingan severity \u003c 1 |\n| `--attach-existing` | mati | Menempel ke Chrome yang berjalan di port 9222 |\n| `--rt` | mati | Proses `rt_hit_list.csv` (mode batalkan repost) |\n| `--log-file PATH` | `xpostdeleter.log` | Path file log |\n| `--debug-rt` | mati | Log deteksi RT/repost yang lebih detail |\n\n---\n\n### Struktur proyek\n\n```\nXPostDeleter/\n  delete_agent.py        # Entry point (CLI)\n  actions.py             # Rutinitas hapus / batalkan repost\n  browser.py             # Factory ChromeDriver \u0026 navigasi\n  human.py               # Mouse, scroll, timing seperti manusia\n  utils.py               # Logging tee \u0026 progress bar\n  archive_scanner.py     # Pindai arsip → delete_hit_list.csv\n  image_analyzer.py      # Pengenalan wajah \u0026 deteksi NSFW\n  text_analyzer.py       # Analisis teks 3 tahap (keyword / Gemini / Claude)\n  keywords.json.example  # Template daftar keyword (salin ke keywords.json)\n  .env.example           # Template variabel lingkungan\n  requirements.txt       # Dependensi Python\n```\n\n### Disclaimer\n\n\u003e **Baca dengan seksama sebelum digunakan.**\n\n- Alat ini hanya untuk **penggunaan pribadi** — menghapus postingan milikmu sendiri.\n- Interaksi browser otomatis mungkin melanggar Ketentuan Layanan X — **gunakan dengan risiko sendiri**.\n- Saat dijalankan, **jangan sentuh mouse** (pyautogui mengontrolnya).\n- Jaga ukuran batch tetap wajar (20–50 per run) untuk mengurangi risiko deteksi.\n- **Deteksi AI (gambar, NSFW, dan teks) tidak sempurna.** False positive akan terjadi — postingan yang sama sekali tidak terkait dengan target yang kamu maksud bisa saja masuk ke daftar hapus. **Selalu tinjau `delete_hit_list.csv` sebelum menjalankan agen penghapus.** Penulis tidak bertanggung jawab atas postingan yang terhapus akibat false positive atau kesalahan deteksi.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuuka-dev%2Fxpostdeleter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyuuka-dev%2Fxpostdeleter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyuuka-dev%2Fxpostdeleter/lists"}