Page 1 of 1

Updating Kodi HTTP 401 error

Posted: 07 Dec 2016, 18:45
by iampaulh
I added a password to Kodi's remote control via HTTP

I'm calling --def xbmc=localhost:80 and now get a 401 error, naturally

How do I pass the username and password to Kodi? I see that Plex has a token system, but can't seem to find anything on the forum about Kodi

Re: Updating Kodi HTTP 401 error

Posted: 08 Dec 2016, 01:39
by rednoah
401 means access denied. You can pass username and password same as with URLs.

e.g.

Code: Select all

--def kodi=username:password@server:port

Re: Updating Kodi HTTP 401 error

Posted: 10 Dec 2016, 23:28
by iampaulh
Thanks, but I'm still getting the 401 error, even with the correct username, password, port, and host

AMC log says

Code: Select all

Notify Kodi: [host:kodi:Kodipassword@localhost, port:80]
GET: http://kodi:Kodipassword@localhost:80/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ShowNotification%22%2C%22params%22%3A%7B%22title%22%3A%22FileBot+finished+processing+1+files%22%2C%22message%22%3A%22Newshow.mkv%22%2C%22image%22%3A%22http%3A%2F%2Fapp.filebot.net%2Ficon.png%22%7D%2C%22id%22%3A1%7D
Server returned HTTP response code: 401 for URL: http://kodi:Kodipassword@localhost:80/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22method%22%3A%22GUI.ShowNotification%22%2C%22params%22%3A%7B%22title%22%3A%22FileBot+finished+processing+1+files%22%2C%22message%22%3A%22NEWShow.mkv%22%2C%22image%22%3A%22http%3A%2F%2Fapp.filebot.net%2Ficon.png%22%7D%2C%22id%22%3A1%7D
However, if I copy and paste the URL from the AMC log into Chrome's simple REST Client, it works.

Re: Updating Kodi HTTP 401 error

Posted: 11 Dec 2016, 02:39
by rednoah
What happens if you load the URL with curl?

Re: Updating Kodi HTTP 401 error

Posted: 11 Dec 2016, 07:52
by iampaulh
If I run CURL from another machine, I get an OK message, but running CURL locally on my kodi box (win10) I get the 401 error!

I tried with localhost, IP address and 127.0.0.1, all give 401 error.

On my other Win10 laptop, using the IP address, it works with: {"id":1,"jsonrpc":"2.0","result":"OK"}

Re: Updating Kodi HTTP 401 error

Posted: 11 Dec 2016, 13:28
by rednoah
Sounds more like a local network, firewall or Kodi issue.

If curl doesn't work, then it's unsurprising that the amc script doesn't either.

Re: Updating Kodi HTTP 401 error

Posted: 04 Mar 2017, 15:20
by vgabor99
Hello,

On my Synology NAS, I get the HTTP 401 too.
Using curl (from the NAS, same user transmission), it's all ok.

The end of amc log:

Notify Kodi: [host:xxx:[email protected], port:8080]
GET: http://xxx:[email protected]:8080/jsonrp ... %22%3A1%7D
IOException: Server returned HTTP response code: 401 for URL: http://xxx:[email protected]:8080/jsonrp ... %22%3A1%7D
Done ヾ(@⌒ー⌒@)ノ

This is the curl call:
transmission@NAS:~$ curl http://xxx:[email protected]:8080/jsonrp ... %22%3A1%7D
{"id":1,"jsonrpc":"2.0","result":"OK"}

This is so weird.
I am pretty sure it's not amc-related but still could use some tips.

Re: Updating Kodi HTTP 401 error

Posted: 04 Mar 2017, 20:29
by vgabor99
PS. now I added the VideoLibrary.Sync and the GUI.Notification calls to the end of my transmission-postprocess script (with curl), and it is working. So I ended up having the same effect. But still it puzzles me why the amc script fails.

Re: Updating Kodi HTTP 401 error

Posted: 05 Mar 2017, 07:28
by rednoah
No idea. Should be exactly the same. The only thing that comes to mind is that FileBot will probably be using your system proxy by default, while curl will not by default.