(2021-11-12, 01:01)HTGeek Wrote: (2021-11-11, 22:22)konrul Wrote: Hello
I want to add some code examples and ask a question:
<<< it is useful if you get info by your browser. All of PVR channel and groups will be displayed.
Code:
/usr/bin/curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"channelid":912}}}' http://yourkodiipishere:8080/jsonrpc]
<<< this code will be open your channel (the channel no that you will see on kodi GUI) use a console like putty.
Code:
curl -s --data-binary '{"jsonrpc": "2.0", "method": "PVR.GetChannels", "params": {"channelgroupid" : "alltv"}, "id": 1 }' -H 'content-type: application/json;' http://yourkodiipishere:8080/jsonrpc]
<<< use with console. This will give you all channel numbers that you can use previous code.
Here is the question:
Why the 1.st code and 3.rd code is resulting different codes? how can I see 3rd code results in web browser?
(BTW: I am sorry for the second post. I couldn't edit my previous wrong one. That is why I post this entry one more time.)
I don't quite understand your question, unless you're confused about why the syntax of the 1st and 3rd code lines are different.
The first example is sending a command to a server via port 8080. It's simply delivering that command via a web browser to (presumably) an API. The third example sends a slightly different command to the same server address, same port number, same API end point, but via CURL. The third line is something you'd type in a Command Line Interface (CLI), such as a SHell program on a server.
They are simply two different methods of delivering a message, depending on the delivery method of the sender. The process on the receiving end (receiving server) is going to be the same. It will receive a command from the API end point and process it. In these examples, the command 1 instruction is different from that in command line 3 (channel ID vs group channel ID).
Thank you for your quick reply.
I understand what you mean, but it is hard to explain I think. in the first code, I am able to see all of results on my browser so that I can find specific channel id quickly. But the 3rd one, which is sent by CLI command, results in a small CLI window and I can't see every details like in the first code. And also, the results are different even if the codes are the same. Let me show an example:
This is the answer from CLI query:
{"channelid":3187,"label":"Büyük Değişim 2.Bölüm EXXEN"}
This is the answer from first code with 8080 port:
{"channelid":3187,"label":"Büyük Değişim 2.Bölüm EXXEN","uniqueid":369625866}
as you can see here, I cant get "uniqueid" from cli results...
On the other hand, I will be thankful if you can advise any way to see all of the results from CLI.
Thank you!