Update Kodi no longer works

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
SuperDOS
Posts: 33
Joined: 20 Mar 2013, 23:34

Update Kodi no longer works

Post by SuperDOS »

Hi,

Not sure what's wrong but since I updated to 4.7 of filebot my amc script don't update the library on my kodi server, the plex server is updated fine (installed on the same server)

use --def kodi=192.1.1.25 and --def plex=192.1.1.25

The remote settings of Kodi is correct since I'm allowed to update it via curl

curl.exe -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://[email protected]:9090/jsonrpc > NUL 2>&1

any ideas?

thanks.
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

Your curl requests just means that the HTTP API is working. FileBot is using (and always has been using) the lower-level TCP (i.e. telnet) to send messages to Kodi.

@see http://kodi.wiki/view/JSON-RPC_API#TCP
:idea: Please read the FAQ and How to Request Help.
SuperDOS
Posts: 33
Joined: 20 Mar 2013, 23:34

Re: Update Kodi no longer works

Post by SuperDOS »

i've tried running

Code: Select all

telnet('192.1.1.25', 9090) { writer, reader ->
   writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
telnet 192.1.1.25 9090 works so I don't understad why using Filebot doesn't.
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

Isn't that literally what FileBot is doing? What else is different? :lol:

* https://github.com/filebot/scripts/blob ... .groovy#L8
* https://github.com/filebot/scripts/blob ... roovy#L477
:idea: Please read the FAQ and How to Request Help.
SuperDOS
Posts: 33
Joined: 20 Mar 2013, 23:34

Re: Update Kodi no longer works

Post by SuperDOS »

precisely :)
used it to debug but doesn't work for some reason.
Would have been a different story if a regular telnet connection wouldn't work.

saw that there was a new version of Filebot, so tried 4.7.1 as well, no luck.
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

So you're saying you've tried this and it's NOT working?

Code: Select all

telnet('192.1.1.25', 9090) { writer, reader ->
   writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
}
Is it "working but nothing happens" or throwing an exception? I'd start by checking if Kodi is sending anything back:

Code: Select all

telnet('192.1.1.25', 9090) { writer, reader ->
   writer.println("""{"jsonrpc":"2.0","method":"VideoLibrary.Scan","id":1}""")
   def br = new BufferedReader(reader)
   println br.readLine()
}
:idea: Please read the FAQ and How to Request Help.
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

I've updated things to use the HTTP API. Please call with -script dev:amc to test the latest revision.
:idea: Please read the FAQ and How to Request Help.
SuperDOS
Posts: 33
Joined: 20 Mar 2013, 23:34

Re: Update Kodi no longer works

Post by SuperDOS »

correct telnet not working, tried with your code but nothing is put out to the console.

the dev:amc works though :)

From logs:
GET: http://192.1.1.25:9090/jsonrpc?request= ... %22%3A1%7D
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

Alright. Let's leave it with simple HTTP GET requests. That'll make things easier to debug if something isn't working.
:idea: Please read the FAQ and How to Request Help.
SuperDOS
Posts: 33
Joined: 20 Mar 2013, 23:34

Re: Update Kodi no longer works

Post by SuperDOS »

great, will this be included in the next release and until then I need to run dev:amc?

thanks!
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

The scripts update themselves. If you call fn:amc sometime next week you it'll probably be running the latest and greatest.

However, if there were people actively using dev:amc then it might be possible to catch some issues before they make it into fn:amc from time to time. ;)
:idea: Please read the FAQ and How to Request Help.
korso
Donor
Posts: 8
Joined: 14 Aug 2016, 19:50

Re: Update Kodi no longer works

Post by korso »

Hello :)

For me it is not working anymore as well. I can update via curl commands through the 9090 port without issues and can telnet to 9090. I get the following in the logs:

Notify Kodi: 192.168.178.41
GET: http://192.168.178.41:9090/jsonrpc?requ ... %22%3A1%7D
Server returned HTTP response code: 400 for URL: http://192.168.178.41:9090/jsonrpc?requ ... %22%3A1%7D
Done ヾ(@⌒ー⌒@)ノ

------ > Curl works fine and i can telnet to 9090:
C:\Users\Administrator\AppData\Local\Apps\cURL\bin>curl.exe -i -X POST -d "{\"js
onrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "co
ntent-type:application/json" http://[email protected]:9090/jsonrpc > NUL 2>&1

--- output from telnet connected to kodi ----

{"jsonrpc":"2.0","method":"VideoLibrary.OnScanStarted","params":{"data":null,"sender":"xbmc"}}{"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"item":{"id":320,"type":"episode"},"transaction":true},"sender":"xbmc"}}{"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"item":{"id":321,"type":"episode"},"transaction":true},"sender":"xbmc"}}{"jsonrpc":"2.0","method":"VideoLibrary.OnScanFinished","params":{"data":null,"sender":"xbmc"}}{"jsonrpc":"2.0","method":"VideoLibrary.OnScanStarted","params":{"data":null,"sender":"xbmc"}}{"jsonrpc":"2.0","method":"VideoLibrary.OnUpdate","params":{"data":{"item":{"id":322,"type":"episode"},"transaction":true},"sender":"xbmc"}}{"jsonrpc":"2.0","method":"VideoLibrary.OnScanFinished","params":{"data":null,"sender":"xbmc"}}

Tried the dev:amc switch but I see it polls port 8080, I have my web service running on 80:

Notify Kodi: 192.168.178.41:8080
GET: http://192.168.178.41:8080/jsonrpc?requ ... %22%3A1%7D
Connection refused: connect
Done ヾ(@⌒ー⌒@)ノ


Is there something I am missing? :(

Any chance we can specify the port where we want to talk to Kodi?
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

The latest revision of the script uses the HTTP API instead of the TCP API. Default port is 8080 but if you have changed it then you can pass it along:

Code: Select all

--def kodi=localhost:8080
:idea: Please read the FAQ and How to Request Help.
korso
Donor
Posts: 8
Joined: 14 Aug 2016, 19:50

Re: Update Kodi no longer works

Post by korso »

rednoah wrote:The latest revision of the script uses the HTTP API instead of the TCP API. Default port is 8080 but if you have changed it then you can pass it along:

Code: Select all

--def kodi=localhost:8080
WOW! That was a fast reply :) This is indeed very excellent support. I can confirm it is working with the dev:amc switch and specifying the port number (:80). Will this be moved to the regular (fn:amc) branch soon?

Btw, I sent a small donation you way, I really like this software, automation at its finest. I wish commercial software had this kind of support!
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

What is the default port number in Kodi? I doubt that port 80 is default for an API. Does it provide a browser-based web interface at the same time as well?
:idea: Please read the FAQ and How to Request Help.
korso
Donor
Posts: 8
Joined: 14 Aug 2016, 19:50

Re: Update Kodi no longer works

Post by korso »

rednoah wrote:What is the default port number in Kodi? I doubt that port 80 is default for an API. Does it provide a browser-based web interface at the same time as well?
I am using osmc (which is Kodi in the end), just in case it makes a difference. Web Server listens in 8080 (I changed it to port 80) by default and the WebSockets interface is 9090 (which i believe is the json/rpc one). I cannot find any other information in regards to this, but I know in the latest osmc they were changing some stuff around. If I understood correctly , before this change, AMC script was using json/rpc calls to port 9090.

Interestingly enough, and as you mentioned, it provides a web interface at the same time.
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

Alright, so 8080 is the default port for HTTP (makes sense) and 9090 is the default port for TCP connections. FileBot no longer uses TCP though because HTTP is easier to debug and test for users.
:idea: Please read the FAQ and How to Request Help.
korso
Donor
Posts: 8
Joined: 14 Aug 2016, 19:50

Re: Update Kodi no longer works

Post by korso »

rednoah wrote:Alright, so 8080 is the default port for HTTP (makes sense) and 9090 is the default port for TCP connections. FileBot no longer uses TCP though because HTTP is easier to debug and test for users.
Thanks for the clarification and for your guidance. Being able to notify kodi directly is really helpful. Let me know if you need any logs from the dev:amc runs. Should I switch back to fn:amc at some point?
User avatar
rednoah
The Source
Posts: 23928
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Update Kodi no longer works

Post by rednoah »

The stable release channel is updated once or twice a month. Using dev:amc is encouraged because it'll help us (i.e. me and you) find and fix issues before they make it into the fn:amc channel.
:idea: Please read the FAQ and How to Request Help.
korso
Donor
Posts: 8
Joined: 14 Aug 2016, 19:50

Re: Update Kodi no longer works

Post by korso »

rednoah wrote:The stable release channel is updated once or twice a month. Using dev:amc is encouraged because it'll help us (i.e. me and you) find and fix issues before they make it into the fn:amc channel.
Cool, thanks again rednoah. I will keep using dev:amc.

Cheers!
Post Reply