2014-06-19, 12:10
Does JSON-RPC API/v6 still support TCP? And if so does it support notification over TCP, or is that a websocket only feature?
(2014-06-19, 12:10)sWORDs Wrote: Does JSON-RPC API/v6 still support TCP? And if so does it support notification over TCP, or is that a websocket only feature?
json_query = uni('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "%s", "properties":["art"]}, "id": 1}' % ((path), media))
path = 'smb://192.168.0.0/TV/Orphan Black/Season 02'
media = 'video'
19:49:03 T:22160 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb://192.168.0.0/TV/Orphan Black/Season 02","media":"video","properties":["art"]}, "id": 1}
19:49:03 T:22160 DEBUG: CUtil::GetMatchingSource: no matching source found for [smb://192.168.0.0/TV/Orphan Black/Season 02]
"file": "smb://192.168.0.0/TV/",
"label": "TV Shows"
(2014-06-30, 07:46)Montellese Wrote: Is it possible that you require usernamed and password for that specific samba share? Because those tend to confuse the CUtil::GetMatchingSource() logic.Thanks for the responce...
(2014-06-30, 10:11)Tolriq Wrote: Well I hope you changed the IP for the sample or use a special network mask, but 192.168.0.0 is not a valid IP with standard mask /24 (255.255.255.0) so i suppose curl or other internals in XBMC does not really well handle that.
Anyway it's not recommended to use .0 as IP as it's usually the network/subnetwork ID
(2014-06-30, 09:03)Montellese Wrote: Could you clarify with what you mean by "in a python IDE" and "from within xbmc"? Do you run the same python code but once as an external JSON-RPC client and once as an XBMC python addon? (sorry I'm not familiar with python)
(2014-06-30, 02:00)Lunatixz Wrote: I'm trying to get a list of all art for a xbmc source folder... info returns fine in a python IDE, but from within xbmc it doesn't work... any ideas?
python code:
Code:json_query = uni('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "%s", "properties":["art"]}, "id": 1}' % ((path), media))
path = 'smb://192.168.0.0/TV/Orphan Black/Season 02'
media = 'video'
Output in xbmc:
Code:19:49:03 T:22160 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb://192.168.0.0/TV/Orphan Black/Season 02","media":"video","properties":["art"]}, "id": 1}
19:49:03 T:22160 DEBUG: CUtil::GetMatchingSource: no matching source found for [smb://192.168.0.0/TV/Orphan Black/Season 02]
Source query to verify path is in white list:
Code:"file": "smb://192.168.0.0/TV/",
"label": "TV Shows"
(2014-06-30, 22:52)ben- Wrote:(2014-06-30, 02:00)Lunatixz Wrote: I'm trying to get a list of all art for a xbmc source folder... info returns fine in a python IDE, but from within xbmc it doesn't work... any ideas?
python code:
Code:json_query = uni('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "%s", "properties":["art"]}, "id": 1}' % ((path), media))
path = 'smb://192.168.0.0/TV/Orphan Black/Season 02'
media = 'video'
Output in xbmc:
Code:19:49:03 T:22160 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb://192.168.0.0/TV/Orphan Black/Season 02","media":"video","properties":["art"]}, "id": 1}
19:49:03 T:22160 DEBUG: CUtil::GetMatchingSource: no matching source found for [smb://192.168.0.0/TV/Orphan Black/Season 02]
Source query to verify path is in white list:
Code:"file": "smb://192.168.0.0/TV/",
"label": "TV Shows"
You might try URL encoding the directory since it contains spaces (or at lease replace the spaces with %20). Might be an interesting data point.
15:28:59 T:8812 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb%3A//192.168.0.1/TV/Rectify/Season%2001","media":"video","properties":["art"]},"id":1}
15:28:59 T:8812 DEBUG: CUtil::GetMatchingSource: no matching source found for [smb%3A/192.168.0.1/TV/Rectify/Season%2001]
15:31:48 T:4852 DEBUG: CUtil::GetMatchingSource: no matching source found for [smb://192.168.0.51/TV/Eagleheart/Season%2001]
15:31:48 T:4852 ERROR: XFILE::CDirectory::GetDirectory - Error getting smb://192.168.0.51/TV/Eagleheart/Season%2001
http://localhost:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb://192.168.0.5/TV/Orphan Black/Season 02","media":"video","properties":["art"]},"id":10}
22:27:09 T:3460 DEBUG: script.pseudotv.live-ChannelList: sendJSON command: {"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb://192.168.0.5/TV/Once Upon a Time (2011)/Season 02","media":"video","properties":["art"]},"id":1}
22:27:09 T:3568 DEBUG: webserver: request received for /jsonrpc
22:27:09 T:3568 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb://192.168.0.5/TV/Once Upon a Time (2011)/Season 02","media":"video","properties":["art"]},"id":1}
22:27:09 T:3568 DEBUG: CUtil::GetMatchingSource: no matching source found for [smb://192.168.0.5/TV/Once Upon a Time (2011)/Season 02]
(2014-07-04, 06:41)Montellese Wrote: XBMC gets the list of defined sources (based on sources.xml) and checks if one of them has a common base path with the path you passed in. But that shouldn't differ depending on where you sent it from.
Can you check your sources.xml?
<source>
<name>TV Shows</name>
<path pathversion="1">smb://192.168.0.5/TV/</path>
<allowsharing>true</allowsharing>
</source>