Recent Changes - Search:



edit SideBar


You can write python code inside regex or write python code in .py file, put in the profile directory and then call from your regex.

You can execute python functions within regex, the format is $pyFunction.FileName.FunctionName
first parameter must be page_data, even if you dont need any page data

for example, if i want to add 2+4, i have created that function and stored in file. this file should be copied in following directory which means with updates you wont lose your function file, please keep the backup of your files, just in case: \\Kodi\root\userdata\addon_data\

def addme(page_data,a,b):
    return a+b

now, this function should be part of a regex, which then could be used anywhere, since we support regex in regex, you can pass any static of dynamic parameters. If you need the page_data, it will also be available. the function call should result in proper python syntax.
sample call

    <title>function test</title>

Note, this will not run anything but if you look in the log file, CDVDPlayer::OpenInputStream - error opening [http://6] which means it worked.

This will allow you to write python functions, like current date time in certain format, or do the calculation which otherwise is too difficult via web calls.
Another example, say if you want to call python functions, if those are simple functions then you can even call them directly, you don’t have to write another regex or function for example
If I want to decode the base64 text, get the text via another regex (i am lazy so i hard coded it, you would want to get via dynamic regex) but you can now write regex which contain static text, not Useful at all but useful when you have to use same big text many places.
Note that b64decode is not using page_data as parameter because it doesn't need to.

    <title>function test2</title>

Also support in PAGE output of regex but not neccessary a page urls, for example, here get-decrypted-rtmp returns a string not html page url


External link to another file via URL use externallink and point it to the url where the file is hosted, this supported both in Items and as well as Channels format. For item, leave the link tag with something dummy and enter the new tag with correct data, while in channels format there is no link.

Edit - History - Print - Recent Changes - Search
Page last modified on February 25, 2016, at 05:53 PM