OkLine
Health Gecti
- License — License: NOASSERTION
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 11 GitHub stars
Code Gecti
- Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Unofficial LINE API Python SDK — automate your personal LINE Messenger account: QR code login in your terminal, send/receive messages, E2EE Letter Sealing, bot framework & CLI. No developer account, no webhook. Reproduces the LINE Chrome extension protocol (CHROMEOS 3.7.2, X-Hmac/WASM). pip install okline.
OkLine
✅ Verified against LINE Chrome extension 3.7.2 — September 2026 (v2.9.2)
OkLine is an unofficial Python SDK for LINE Messenger that lets you automate
your own personal account: log in by scanning a QR code in your terminal,
send and receive messages and media as yourself, and decrypt E2EE Letter
Sealing — with no developer account, no bot channel, and no webhook. It
faithfully reproduces the API of the official LINE Chrome extension
(CHROMEOS 3.7.2), including the mandatory X-Hmac signature computed by
LINE's real ltsm.wasm, so requests are byte-for-byte what the real client
sends.
Log in with a QR code — no developer account, no channel access token:
from okline import OkLine
from okline.qrterm import print_qr # ASCII QR in the terminal (pip install qrcode)
api = OkLine()
api.qr_login(on_qr=print_qr) # scan the QR with the LINE app, confirm the PIN
api.save_tokens("session.json") # session (incl. E2EE keys) — reused forever
api.send_text("c…group…mid", "hi from python")
Or pick up an existing session by token:
from okline import OkLine
api = OkLine(access_token="…", refresh_token="…")
print(api.get_profile())
api.send_text("u0123456789abcdef0123456789abcdef", "hello from python")
ภาษาไทย
OkLine คือ Python SDK (ไม่เป็นทางการ) สำหรับทำบอท LINE บัญชีส่วนตัว —
ล็อกอินด้วย QR code ในเทอร์มินัล ส่ง-รับข้อความและไฟล์ในนามตัวคุณเอง
และถอดรหัส E2EE Letter Sealing ได้ โดยไม่ต้องสมัคร developer account
ไม่ต้องมี channel หรือ webhook จึงเป็น line notify ทางเลือกสำหรับ
ส่งข้อความ LINE ด้วย Python ฟรีแบบไม่จำกัด — อ่านคู่มือฉบับภาษาไทยได้ที่
เอกสารภาษาไทย
Features
- All 77 endpoints — typed methods, or call any of them generically.
- QR & e‑mail login — QR rendered as ASCII right in your terminal.
X-Hmacsigning — handled automatically via the bundled WASM module.- Bot framework —
@bot.on_message, typed models, session persistence. - E2EE Letter Sealing — send and decrypt sealed messages and media (1:1 and group).
- Response recording — capture, redact and export every request/response.
- CLI —
python -m okline …to call any endpoint from the shell.
Install
pip install okline
Or as an isolated CLI tool with uv — the qr
extra bundles the terminal QR renderer:
uv tool install "okline[qr]"
The bundled ltsm.wasm (for X-Hmac signing) ships inside the wheel, so that's
all you need from Python. With a plain pip install, optionallypip install qrcode to render the QR-login code in your terminal.
Prerequisites
- Python 3.9+
- Node.js 18+ on your
PATH— required to compute the mandatoryX-Hmac
request signature (the realltsm.wasmruns through a tiny Node bridge;
details). Check withnode --version.
Verify it works:
python -m okline version
Install from source instead
git clone https://github.com/NiceDayZc/okline.git
cd okline
pip install -e . # editable install of the okline package + deps
First login (do this once; the session is then reusable):
okline login # scan the QR with the LINE app — saves tokens.json
Then just run okline for an interactive, menu-driven UI (pick actions by
number), or use any of the ~30 subcommands directly:
okline # interactive menu (soft colours, no setup)
okline whoami
okline send <mid> "hello"
okline contacts --search soda
okline chatlog <chat-mid> # reads and decrypts recent messages
okline -h # full command list
Quick start
from okline import OkLine, Bot
# log in once, reuse the session forever
api = OkLine()
api.auth.qr_login(on_qr=print) # scan the QR with your phone
api.save_tokens("session.json")
# next time
api = OkLine.from_tokens_file("session.json")
api.send_text("c…group…mid", "hi from python")
# a 3-line echo bot
bot = Bot(api)
bot.on_message(lambda ctx: ctx.reply(f"you said: {ctx.text}"))
bot.run()
From the shell — okline login once, then everything reuses the session:
okline login # scan the QR; saves tokens.json
okline send <mid> "hello"
okline call Talk.TalkService.getProfile "[2]"
OkLine vs line-bot-sdk (official) vs linepy
| OkLine (unofficial) | line-bot-sdk (official) | linepy (unofficial, abandoned) | |
|---|---|---|---|
| Account type | Your personal LINE account | A separate bot/official account users must befriend | Personal account |
| Login | QR code (ASCII in terminal) or e-mail | Channel access token (requires developer registration, provider, channel) | E-mail/password (flows broken; QR undocumented) |
| Developer registration | None | Required (developers.line.biz) | None |
| Send as yourself to your contacts | Yes | No — bot sends to followers only, by opaque userId | Partially (protocol rot) |
| Receive messages | Polling — no public webhook, no ngrok, no server | Webhook only (public HTTPS endpoint required) | Polling (broken) |
| E2EE Letter Sealing | Yes — send and decrypt, incl. HMAC-verified media | No (server-side bots read plaintext) | No (fails with TalkException code 82) |
| Push limits | Unlimited (your own account) | ~200 free push msgs/month | n/a |
| Protocol fidelity | Byte-for-byte LINE Chrome extension (CHROMEOS 3.7.2) incl. X-Hmac via real ltsm.wasm | Official REST API | Stale thrift defs (akad-era) |
| Bot framework & CLI | Yes (@bot.on_message, python -m okline) |
SDK only (build your own) | Selfbot scripts |
| Maintenance | Active, live-tested (v2.9.2, Sept 2026) | Active (official) | Last release Jan 2018 / ~2015 |
| ToS risk | Yes — personal-account automation violates LINE ToS | No | Yes |
More detail on the comparison page.
FAQ
How do I send a LINE message from Python without a developer account?pip install okline, log in once by scanning a QR code in your terminal, thenapi.send_text(mid, "hello"). No provider, no channel, no channel access token,
no webhook — OkLine talks to LINE as your own logged-in account.
QR-login guide
How do I log in to LINE from Python with a QR code?api.qr_login(on_qr=print_qr) renders the login QR as ASCII right in your
terminal; scan it with the LINE app, confirm the PIN, and the session (including
your E2EE keys) is saved to JSON and auto-refreshed on later runs. Or just runokline login. QR-login guide
How can my bot send messages as ME, to my own contacts and groups?
OkLine addresses your actual contact list and group chats — search contacts,
list groups, and send to any chat you can see in the app. The official Messaging
API can only push to opaque user IDs of users who befriended the bot, which is
where the 'to' field is invalid errors come from.
How do I read my own LINE chats from Python (without a public webhook or ngrok)?
OkLine receives events the same way the real client does — as the logged-in
account — so there is no public HTTPS endpoint, no ngrok, and no server to run.okline chatlog <chat-mid> reads and decrypts recent history in one command.
LINE Notify shut down (March 31, 2025) — what's the free, unlimited replacement in Python?
Send to your own account (or any of your chats) with OkLine — free and
unlimited, because it's your own account rather than a service with a monthly
push cap. The LINE Notify replacement
guide shows a
drop-in replacement for the old requests.post-to-notify-bot pattern.
How do I decrypt letter-sealed (E2EE) LINE messages and media in Python?
OkLine implements Letter Sealing end to end: E2EE keys are captured at login,api.decrypt_message(msg) opens sealed text, sealed media is decrypted with
HMAC verification, and api.send_encrypted_text(to, text) sends sealed — for
1:1 and group chats. E2EE guide
What replaces linepy / carpedm20-LINE in 2026?
OkLine: the same idea — automate your own personal account over LINE's Thrift
API — but maintained and live-tested against the current Chrome-extension
protocol, including the X-Hmac signature and Letter Sealing that broke the
old libraries. See the table above and the
comparison page.
Will my LINE account get banned for using an unofficial API?
Honestly: it's a real risk. Automating a personal account violates LINE's Terms
of Service, and LINE Corporation forced code removal from the earlier carpedm20
project in 2014. OkLine cannot remove that risk — use only your own account,
keep volumes human-like, and treat tokens as secrets. See the candid discussion
on the FAQ page.
Documentation
Full docs at nicedayzc.github.io/OkLine
(source in docs/):
| Guide | |
|---|---|
| Getting started | install, okline login, the menu, first Python call |
| Authentication | token reuse, e‑mail (RSA), QR login, refresh, logout |
| Sending messages | text, stickers, location, contacts, flex, reactions |
| Media · E2EE | send images/files · encrypt & decrypt (1:1 + group) |
| Receiving events · Bots | the SSE stream · the bot framework |
| Recording | paste / export every response |
| CLI · Cookbook | every okline command · copy‑paste recipes |
| Architecture | the protocol, X-Hmac, module map |
| Endpoint reference | all 77 endpoints with their fields |
| Troubleshooting · Contributing |
Disclaimer
OkLine is unofficial and not affiliated with LINE Corporation. Use it only
with your own account and in compliance with LINE's
Terms of Service. Treat tokens like
passwords — see SECURITY.md.
License
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi