Browse addons through API
#1
Information 
Hi,

I would like to browse video addons through the API, from RPC with a custom perl code.

How should I proceed ?
I've seen some infos about browsing into kodi itself through the API, but not about browsing addons.

Could you point me to a link where I could get this informations ?

Thanks
Reply
#2
just introspect the json api, or see docs https://kodi.wiki/view/JSON-RPC_API/v8#Addons
Reply
#3
Hi,

Thanks.
So I've got around a bit, and I've managed to send JSON requests, listing me the directory of my plugin, with the help of "Files.GetDirectory" method.
The listing given is a list of files ("filetype":"file").

At this point onto the graphic interface of kodi, the plugin scan for a list of sources for the given file.
How can I handle that task through JSON (getting the list of sources for the given file) ?

I would have figure that the listing should have given me a list of "directories" to browse into the the sources, for the given file.
But as the filetypes are "file" I don't know how to proceed from there...


Thanks in advance
Reply
#4
To make it more clear, I want to call the scrapper within the addon, and get its results from the JSON-RPC interface.
Reply
#5
Here is example of browsing plugin content from my plugin https://github.com/vlmaksime/plugin.video.united.search
 
python:
def get_directory( self, directory ):
request = {'jsonrpc': '2.0',
'method': 'Files.GetDirectory',
'params': {'properties': ['title', 'genre', 'year', 'rating', 'runtime', 'plot', 'file', 'art', 'sorttitle', 'originaltitle'],
'directory': directory,
'media': 'files'},
'id': 1
}
response = xbmc.executeJSONRPC(json.dumps(request))

j = json.loads(response)
result = j.get('result')
if result:
for file in result.get('files', []):
yield file
Where "directory" is path to plugin directory "plugin://plugin.video.tvzavr.ru/action=search&_query=keyword"

You can install this plugin from my repository and test, how it's works on my video plugins
My addons: Gismeteo
Reply
#6
Hi,

Thank you. Yes I went that far.
But the plugin I'm browsing uses a scraper afterward.

So the files listed are not actually files: the plugin launches several scraper.
Onto the GUI interface, if i click onto one of these files, it begins to scrap, then it displays the results.

I'd like to get these scraped results, through JSON-RPC
Reply

Logout Mark Read Team Forum Stats Members Help
Browse addons through API0