Files.GetDirectory please help me

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
isdito Offline
Junior Member
Posts: 5
Joined: Mar 2017
Reputation: 0
Post: #1
Hello.

Any people could explain me why this give me error:

var url:String ='http://192.168.1.150:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"properties": "directory": "home", "media": "files"}}'

Inside videos --> Files --> Movies (This is the path)

ERROR:

{"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}

I am new and I not find all the tree of jason to understand..

Sorry my bad english.
(This post was last modified: 2017-03-10 02:09 by isdito.)
find quote
jonib Offline
Senior Member
Posts: 100
Joined: Mar 2006
Reputation: 2
Post: #2
(2017-03-10 02:01)isdito Wrote:  var url:String ='http://192.168.1.150:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"properties": "directory": "home", "media": "files"}}'
Try this:
Code:
var url:String ='http://192.168.1.150:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"properties": {"directory": "home", "media": "files"}}}'

jonib

XBMC2, EventGhost plugin. [Image: flattr-badge-large.png]
find quote
isdito Offline
Junior Member
Posts: 5
Joined: Mar 2017
Reputation: 0
Post: #3
Hello jonib.

This not work for me, give me

ioErrorHandlerJeff: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://192.168.1.150:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"properties": {"directory": "home", "media": "files"}}}" errorID=2032]


CODE ###########################################################################

import flash.net.*;
import flash.errors.IOError;
import flash.events.Event;
import flash.events.*;
import flash.net.*;
//DEVUELVE LAS LISTAS

var url:String ='http://192.168.1.150:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"properties": {"directory": "home", "media": "files"}}}'
trace (url);
var _request:URLRequest = new URLRequest(url);
_request.method = URLRequestMethod.GET;

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
loader.addEventListener(IOErrorEvent.IO_ERROR, onComplete2);

loader.dataFormat = URLLoaderDataFormat.TEXT;
loader.load(_request);

function onComplete (evt:Event):void {
trace(evt.target.data);
}
function onComplete2 (e:IOErrorEvent):void {
trace("VAMOS A VER QUE ERROR: " + e.toString());
}
####################################################################

What do you tink. Where is all the methods and all the properties. Thank you for all
(This post was last modified: 2017-03-10 12:37 by isdito.)
find quote
isdito Offline
Junior Member
Posts: 5
Joined: Mar 2017
Reputation: 0
Post: #4
Hello Ok I fixed.

var url:String ='http://192.168.1.150:8080/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"Files.GetDirectory","params":{"directory":"/home/osmc/Movies", "media":"video"}}'


It is necesary
1.- a id
2.- you must create a path of the video directory inside Kodi
3.- Capitalization be carefull
4.- Not put files put video in the type of media
5.- Also I put port 8080 free to the ip

This works in this moment.
find quote
Wimpie Offline
Senior Member
Posts: 211
Joined: Nov 2012
Reputation: 6
Post: #5
Don't know if you need it, but "media = files" does work for me:

Code:
JSON_req = {"jsonrpc":"2.0",
                    "id":1,
                    "method":"Files.GetDirectory",
                    "params":{"directory":my_dir_unicode, "media":"files"}}
gives:

Code:
{u'id': 1,
u'jsonrpc': u'2.0',
u'result': {u'files': [{u'file': u'W:\\Everybody Wants Some!! (2016)\\Everybody Wants Some!! (2016).BluRay.strm',
                         u'filetype': u'file',
                         u'label': u'Everybody Wants Some!! (2016).BluRay.strm',
                         u'type': u'unknown'},
                        {u'file': u'W:\\Everybody Wants Some!! (2016)\\fanart.jpg',
                         u'filetype': u'file',
                         u'label': u'fanart.jpg',
                         u'type': u'unknown'},
                        {u'file': u'W:\\Everybody Wants Some!! (2016)\\movie.nfo',
                         u'filetype': u'file',
                         u'label': u'movie.nfo',
                         u'type': u'unknown'},
                        {u'file': u'W:\\Everybody Wants Some!! (2016)\\poster.jpg',
                         u'filetype': u'file',
                         u'label': u'poster.jpg',
                         u'type': u'unknown'},
                        {u'file': u'W:\\Everybody Wants Some!! (2016)\\BIUfiles\\',
                         u'filetype': u'directory',
                         u'label': u'BIUfiles',
                         u'type': u'unknown'}],
             u'limits': {u'end': 5, u'start': 0, u'total': 5}}}

Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
find quote