You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All routes live under /api except /privacy and /terms. Auth-protected routes expect Authorization: Bearer <access_token> (15-min JWT).
Base URL:http://localhost:7680/api (or your own deployment URL)
Route Map (11 routers)
Router
Prefix
Auth
Purpose
auth
/api/auth
Mixed
Login, tokens, sessions
files
/api/files
JWT
File CRUD, progress, sharing
folders
/api/folders
JWT
Folder tree CRUD
streaming
/api/stream
Download token / public
Video streaming
tv
/api/tv
JWT
TV-optimized browsing
grab
/api/grab
JWT
Movie search & import
gdrive
/api/gdrive
JWT
Google Drive import
subtitles
/api/subtitles
JWT
Subtitle search & fetch
admin
/api/admin
Admin
User management, stats
diag
/api/diag
DEBUG_PASSWORD
Health & diagnostics
legal
/privacy, /terms
None
Static HTML pages
Authentication (/auth)
Method
Path
Auth
Description
GET
/auth/bot/info
None
Bot username for login deep-links
POST
/auth/generate-code
None
Create TV pairing code (10 min TTL)
POST
/auth/verify-code
None
Poll: code claimed? → returns token pair
POST
/auth/code
None
Legacy alias for verify-code
POST
/auth/refresh
Refresh token
Rotates refresh token; replay = 401
GET
/auth/me
JWT
Current user profile
POST
/auth/logout-all
JWT
Bump auth_version, kill all sessions
Login flow (TV)
1. POST /auth/generate-code → {code, bot_username, expires_in}
2. User sends /start <CODE> to bot in Telegram
3. TV polls POST /auth/verify-code → {access_token, refresh_token}
4. On 401 later: POST /auth/refresh with refresh_token
Files (/files)
Method
Path
Description
GET
/files
List files (paginated, filter by folder)
GET
/files/recent
Recently added
GET
/files/continue-watching
In-progress items
GET
/files/storage
Quota usage summary
GET
/files/{file_id}
File metadata
PATCH
/files/{file_id}
Rename / move file
DELETE
/files/{file_id}
Delete file (+ Telegram message)
POST
/files/batch-delete
Delete many at once
POST
/files/batch-move
Move many to folder
PUT/POST
/files/{file_id}/progress
Save watch position
GET
/files/{file_id}/progress
Get watch position
POST
/files/{file_id}/share
Enable public share (returns hash)
DELETE
/files/{file_id}/share
Disable public share
POST
/files/{file_id}/download-token
Mint 30-day streaming token
Folders (/folders)
Method
Path
Description
GET
/folders
List root-level folders
GET
/folders/tree
Full nested tree
GET
/folders/{folder_id}
One folder
POST
/folders
Create folder
PATCH
/folders/{folder_id}
Rename / move
DELETE
/folders/{folder_id}
Delete subtree
POST
/folders/batch-delete
Delete many
POST
/folders/batch-move
Move many
Streaming (/stream) — no JWT, uses download tokens
Method
Path
Auth
Description
GET
/stream/{file_id}?token=...
Download token
Video stream w/ Range support (206)
GET
/stream/dl?...
Download token
Direct download (Content-Disposition)
GET
/stream/{file_id}/thumbnail?token=...
Download token
JPEG thumbnail
GET
/stream/s/{public_hash}
None
Public shared stream
GET
/stream/debug
DEBUG_PASSWORD
Cache/session internals
Range behavior: single range → 206 Partial Content; multi-range → coalesced into one; open-ended (bytes=100-) and suffix (bytes=-500) supported; zero-byte files → plain 200.