imou / Imou / 乐橙 / lechange 设备视频与录像技能。支持实时预览 live HLS、本地/云录像片段查询、录像回放 HLS。 Imou/Lechange device video skill for live HLS, local/cloud record clips, and playb...
Get device live HLS URL, local/cloud record clips, and record playback HLS URL by device channel. For OpenClaw download, play, and record.
Install dependency:
bash
pip install requests
Set environment variables (required):
bash
export IMOU_APP_ID="your_app_id"
export IMOU_APP_SECRET="your_app_secret"
export IMOU_BASE_URL="your_base_url"
API Base URL (IMOU_BASE_URL) (required; no default—must be set explicitly):
appId and appSecret from App Information.appId and appSecret from App Information. See Development Specification.RegionData CenterBase URLMainland China—https://openapi.lechange.cnOverseasEast Asiahttps://openapi-sg.easy4ip.com:443OverseasCentral Europehttps://openapi-fk.easy4ip.com:443OverseasWestern Americahttps://openapi-or.easy4ip.com:443
Run:
bash
# Get live HLS URL for a device channel (creates live if needed; if LV1001, fetches from live list)
python3 {baseDir}/scripts/device_video.py live DEVICE_ID CHANNEL_ID [--stream-id 0|1]
# Get local or cloud record clips in a time range
python3 {baseDir}/scripts/device_video.py record-clips DEVICE_ID CHANNEL_ID --begin "yyyy-MM-dd HH:mm:ss" --end "yyyy-MM-dd HH:mm:ss" [--local|--cloud] [--count 100] [--query-range 1-100]
# Get record playback HLS URL for a time range (local or cloud)
python3 {baseDir}/scripts/device_video.py playback-hls DEVICE_ID CHANNEL_ID --begin "yyyy-MM-dd HH:mm:ss" --end "yyyy-MM-dd HH:mm:ss" --record-type localRecord|cloudRecord [--stream-id 0|1]
All requests to Imou Open API include the header Client-Type: OpenClaw for platform identification.
APIDocDev spechttps://open.imou.com/document/pages/c20750/Get accessTokenhttps://open.imou.com/document/pages/fef620/Create device live (bindDeviceLive)https://open.imou.com/document/pages/1bc396/Create device record HLShttps://open.imou.com/document/pages/185646/Get live list (liveList)https://open.imou.com/document/pages/b0e047/Query local recordshttps://open.imou.com/document/pages/396dce/Query cloud recordshttps://open.imou.com/document/pages/8e0e35/
See references/imou-video-api.md for request/response formats.
--stream-id 0 (main stream) or 1 (sub stream). If API returns LV1001, the script falls back to liveList to find the existing HLS for the same device/channel/streamId.--local uses queryLocalRecords (param count, max 100; some devices limit to 32). --cloud uses queryCloudRecords (param queryRange e.g. 1-100). Paginate by using the last clip’s endTime as next beginTime.yyyy-MM-dd HH:mm:ss; no cross-day range. Record type localRecord or cloudRecord. Use the URL promptly; it expires.DataSent toPurposeappId, appSecretImou Open APIObtain accessTokenaccessToken, deviceId, channelId, etc.Imou Open APILive, record clips, playback HLS
All requests go to the configured IMOU_BASE_URL. No other third parties.