Реклама показывается только незарегистрированным пользователям. Вход или Регистрация

LG WebOS undocumented API

Программирование для webOS, инструменты разработки, документация, обмен опытом

LG WebOS undocumented API

Сообщение diaahussein » 15 июн 2021, 02:42

Hi Team,
i am trying to find out all about the LG WebOS undocumented API

here is what i have found so far
please feel free to share with me if you have any additions

#get broadcastID
Код: Выделить всё
ls-monitor | grep -a -m 4 -h "broadcastId" | grep -oE "\b[0-9, a-z]{8}\-[0-9, a-z]{4}-[0-9, a-z]{4}-[0-9, a-z]{4}-[0-9, a-z]{12}\b" | tail -1

#get current channelID
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.service.utp.broadcast/getCurrentChannel '{"broadcastId": "'$broadcastid'", "subscribe": false}'| grep -a -h "channelId" | grep -oE "\b[0-9, a-z]{1}_[0-9, a-z]{3}_[0-9, a-z]{1}_[0-9, a-z]{1}_[0-9, a-z]{2}_[0-9, a-z]{3}_[0-9, a-z]{3}\b"

#show recording dialog
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.applicationManager/launch '{"id": "com.webos.app.dvrpopup", "noSplash": true, "params": {"activateType": "instantRecord", "broadcastId": "'$broadcastid'", "channelId": "'$channelid'", "inputType": "TV", "isDelayed": false, "isDvb": true}}'

#start recording and show recordingID

Код: Выделить всё
luna-send -n 1 -f luna://com.webos.service.utp.dvr/record/startProgramRecord '{ "camPinCode": "", "channelId": "'$channelid'", "duration": 2880, "endTime": { "day": 12, "hour": 20, "minute": 0, "month": 6, "second": 28, "year": 2021 }, "programId": "2048_59_10_46306", "quality": "record_quality_high", "recordingMode": "recording_direct", "storagePath": "/tmp/usb/sdb/sdb1/LG Smart TV" } '| grep recordingId | awk '{print substr ($2, 2, length ($2) -3) }'

#stop recording by recordingID
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.service.utp.dvr/record/stopRecord '{"needSave": true, "recordingId": "'$recordingid'" } '

#close application by ID
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.applicationManager/closeByAppId ' {"id":"netflix"} '

#Mute
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.service.audiooutput/audio/volume/muteSoundOut ' {"mute":true, "soundOutput":"tv_external_speaker"} '

#UnMute
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.service.audiooutput/audio/volume/muteSoundOut ' {"mute":false, "soundOutput":"tv_external_speaker"} '

#changechannel you must get the current broadcastID and the new channelID, old is irrelevent
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.service.utp.broadcast/changeChannel ' {"channelId":"7_124_2_0_47_4712_2048", "broadcastId":"00000011-1dd3-acb4-84f7-41b645a4a528", "currentChannelId":"7_208_3_0_59_10_2048"} '


#to take a screenshot
Код: Выделить всё
luna-send -n 1 -f luna://com.webos.surfacemanager/captureCompositorOutput '{"output":"/tmp/usb/sda/sda1/NAS/shares/screenshot-temp.jpg", "format":"JPG"}'


Код: Выделить всё
luna-send -n 1 -f 'luna://com.webos.service.capture/executeOneShot' '{"path":"/tmp/usb/sda/sda1/NAS/shares/capture.png", "method":"DISPLAY", "format":"PNG"}'



#get current foregound application
Код: Выделить всё
luna-send -n 1 luna://com.webos.applicationManager/getForegroundAppInfo '{}'

#set master volume to 30
Код: Выделить всё
luna-send -f -n 1 luna://com.webos.service.audio/master/setVolume '{"volume":30}'



to add an application as a device input I am using here webvideo caster as a sample

Код: Выделить всё
vi /media/cryptofs/apps/usr/palm/applications/com.instantbits.cast.webvideo/appinfo.json

2.add a line
"supportGIP":true,

3.make a full preload so that the data is updated with the command
reboot

3.register the app as a login device
luna-send-pub -n 1 'luna://com.webos.service.eim/addDevice' '{"appId":"com.instantbits.cast.webvideo", "pigImage":""}'
luna-send-pub -n 1 'luna://com.webos.service.eim/deleteDevice' '{"appId":"com.instantbits.cast.webvideo", "pigImage":""}'




below is a link to my Github where I have a list of bash scripts that can be used for varies applications on LG based on the above function

Volume.sh
automatic control the volume based on the running application

recording.sh
start recording of the current channel and stop after 20 Seconds

my Github reposatory
https://github.com/diaahussein/WebOS_LG_TV_Scripts
Последний раз редактировалось diaahussein 17 июн 2021, 02:50, всего редактировалось 3 раз(а).

За это сообщение автора diaahussein поблагодарили: 6
AlexMaestro (15 июн 2021, 06:28), andrewttrb (21 июн 2021, 11:12), etix (01 июл 2021, 22:59), InvisiBot (15 июн 2021, 10:45), IRoN (27 янв 2024, 04:18), m.ksy (29 июн 2021, 01:43)
diaahussein

 
Сообщения: 2
Зарегистрирован: 11 июн 2021, 06:16
Благодарил (а): 2 раз.
Поблагодарили: 6 раз.
Телевизор: LG 55up8150

LG WebOS undocumented API

Спонсор » 15 июн 2021, 02:42

Реклама показывается только незарегистрированным пользователям. Войти или Зарегистрироваться
Спонсор

 
Сообщения: 100
Зарегистрирован: 15 июл 2014, 18:43
Благодарил (а): 0 раз.
Поблагодарили: 0 раз.

Re: LG WebOS undocumented API

Сообщение andrewttrb » 15 июн 2021, 10:18

diaahussein писал(а):please feel free to share with me if you have any additions

some useful stuff here

За это сообщение автора andrewttrb поблагодарили: 4
Архивариус (15 июн 2021, 11:14), diaahussein (17 июн 2021, 01:46), InvisiBot (15 июн 2021, 10:46), IRoN (27 янв 2024, 04:18)
andrewttrb

 
Сообщения: 290
Зарегистрирован: 01 янв 2021, 20:22
Благодарил (а): 23 раз.
Поблагодарили: 207 раз.
Телевизор: LG OLED65CX

Re: LG WebOS undocumented API

Сообщение diaahussein » 17 июн 2021, 01:46

andrewttrb писал(а):
diaahussein писал(а):please feel free to share with me if you have any additions

some useful stuff here


great stuff
diaahussein

 
Сообщения: 2
Зарегистрирован: 11 июн 2021, 06:16
Благодарил (а): 2 раз.
Поблагодарили: 6 раз.
Телевизор: LG 55up8150


Вернуться в Разработка и создание программ для LG webOS