HOW-TO:Remotely update library: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
>Powder21
No edit summary
Line 9: Line 9:
* '''Video:''' <code><nowiki>curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;'  http://localhost:9191/jsonrpc</nowiki></code>
* '''Video:''' <code><nowiki>curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;'  http://localhost:9191/jsonrpc</nowiki></code>
* '''Audio:''' <code><nowiki>curl --data-binary '{ "jsonrpc": "2.0", "method": "AudioLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;'  http://localhost:9191/jsonrpc</nowiki></code>
* '''Audio:''' <code><nowiki>curl --data-binary '{ "jsonrpc": "2.0", "method": "AudioLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;'  http://localhost:9191/jsonrpc</nowiki></code>
==Windows Command Line==
You will need the Win32 2000/XP binary version of cURL by Günter Knauf.  Download it here: http://curl.haxx.se/
Create a cURL folder in the Program Files directory and place the contents of the zip file in the root of that folder.  (You can put it elsewhere if you like just make sure you modify the code to reflect the location of the exe file)
* '''Video:''' <code><nowiki>"C:\Program Files (x86)\cURL\curl.exe" -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://user:pass@localhost:port/jsonrpc > NUL 2>&1</nowiki></code>
* '''Audio:''' <code><nowiki>"C:\Program Files (x86)\cURL\curl.exe" -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"AudioLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://user:pass@localhost:port/jsonrpc > NUL 2>&1</nowiki></code>
The " > NUL 2>&1" stops the command from displaying any output (for instance, when running a batch file).  You can leave that out if you want.


[[Category:How-to]]
[[Category:How-to]]

Revision as of 09:02, 23 February 2013

Some quick methods to updating the XBMC library outside of the XBMC interface.

HTTP

  • Video: http://<User>:<Password>@<hostname>:<port>/jsonrpc?request={"jsonrpc":"2.0","method":"VideoLibrary.Scan"}
  • Audio: http://<User>:<Password>@<hostname>:<port>/jsonrpc?request={"jsonrpc":"2.0","method":"AudioLibrary.Scan"}

Command line

  • Video: curl --data-binary '{ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://localhost:9191/jsonrpc
  • Audio: curl --data-binary '{ "jsonrpc": "2.0", "method": "AudioLibrary.Scan", "id": "mybash"}' -H 'content-type: application/json;' http://localhost:9191/jsonrpc

Windows Command Line

You will need the Win32 2000/XP binary version of cURL by Günter Knauf. Download it here: http://curl.haxx.se/ Create a cURL folder in the Program Files directory and place the contents of the zip file in the root of that folder. (You can put it elsewhere if you like just make sure you modify the code to reflect the location of the exe file)


  • Video: "C:\Program Files (x86)\cURL\curl.exe" -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"VideoLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://user:pass@localhost:port/jsonrpc > NUL 2>&1
  • Audio: "C:\Program Files (x86)\cURL\curl.exe" -i -X POST -d "{\"jsonrpc\": \"2.0\", \"method\": \"AudioLibrary.Scan\", \"id\": \"mybash\"}" -H "content-type:application/json" http://user:pass@localhost:port/jsonrpc > NUL 2>&1


The " > NUL 2>&1" stops the command from displaying any output (for instance, when running a batch file). You can leave that out if you want.