Skip to main content

line-ext-msg

ดึงข้อความ (เวลา + คนส่ง + ข้อความ + วันที่ + สถานะ) จาก LINE Chrome Extension ผ่าน Playwright แบบเกาะ Chrome ตัวจริง บัญชีของตัวเอง อ่านอย่างเดียว

ติดตั้ง

pip install line-ext-msg

ต้องมี Google Chrome ในเครื่อง ไม่ต้องรัน playwright install เพราะโปรแกรมเกาะ Chrome ที่มีอยู่ผ่าน CDP ไม่ได้ใช้ bundled chromium

ใช้งาน CLI

line-ext-msg                       # เลือกห้องใน Terminal → พิมพ์จออย่างเดียว ไม่สร้างไฟล์
line-ext-msg --save                # + เขียน rooms.json + messages_{index}.json
line-ext-msg --unread               # แสดงเฉพาะห้องที่ไม่อ่าน
line-ext-msg --limit 10 --date 2026-09-12
line-ext-msg --date-from 2026-09-01 --date-to 2026-09-12 --keyword "ใบแจ้งหนี้"
line-ext-msg --search "ใบแจ้งหนี้"  # ค้นทุกห้อง สรุปห้องที่เจอ

ครั้งแรก: โปรแกรมเปิด Chrome โปรไฟล์แยก %LOCALAPPDATA%\line-chrome-debug ให้เอง ติดตั้ง LINE + ล็อกอินครั้งเดียวในหน้าต่างนั้น หลังจากนั้น auto หมด (Chrome 136+ บล็อก --remote-debugging-port บนโปรไฟล์หลักโดยตรง จึงต้องใช้โปรไฟล์แยก)

หน้าตาไฟล์ JSON ที่ได้

{
  "room": { "index": 0, "id": "CXX...", "name": "ครอบครัว", "unread": 3,
            "last_preview": "กินข้าวยัง", "last_time": "8:13 AM" },
  "fetched_at": "2026-09-12T01:00:00+00:00",
  "messages": [
    { "id": "0178...", "date": "2026-09-12", "ts": "2026-09-12T08:13:00",
      "sender": "แม่", "from_me": false, "type": "text",
      "text": "กินข้าวยัง", "read_count": null }
  ]
}

ข้อจำกัดที่ควรรู้

  • อ่านได้เฉพาะแถวที่ render บนจอ (virtualized list) ประวัติย้อนหลังลึกต้อง scroll เพิ่ม (ยังไม่ทำ)
  • ได้เฉพาะที่ UI แสดง ไม่มี API สถานะอ่านรายข้อความ
  • from_me เป็น heuristic (ไม่มี username = เราส่ง) ยังไม่ยืนยันด้วย dump ที่มีข้อความของตัวเอง

dev

uv sync
uv run pytest
uv build

ถ้าอ่านห้องไม่ได้ (LINE อัปเดต UI)

line-ext-msg --dump              # DOM หน้า chats → line_dom.html
line-ext-msg --dump-room 0       # DOM ในห้อง → line_room.html
# ส่งไฟล์มาเพื่อจูน selector ใน src/line_ext_msg/settings.py

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

line_ext_msg-1.0.0.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

line_ext_msg-1.0.0-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file line_ext_msg-1.0.0.tar.gz.

File metadata

  • Download URL: line_ext_msg-1.0.0.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for line_ext_msg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ba3e39931e5fa79af684f41cf66995b2b36529d4c0861df4955333ac9f86760b
MD5 800893ac7a493d3f7acd3d1bf0de44a3
BLAKE2b-256 a4a2320a75be57ba90bfe7e8c402c57e00004cddfc3ea96f48f77e9800ca5608

See more details on using hashes here.

File details

Details for the file line_ext_msg-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: line_ext_msg-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for line_ext_msg-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bab496e6c8a134f5e342eb00871ff0327ebdd872107754fc98f2fc19d68c91af
MD5 7eba86b362d09fbc9653ed8ccd4c51bf
BLAKE2b-256 9c468cbdb99979414143a338eea449605af4090a2fdf6e7a7408ca04d8b2ca83

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

1.1.0

2 files

This release

1.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page