
Audrey addon script and Audrey Tester
This Audrey script has been made to help make creating Kodi addons a lot easier. To the extent that if you download the Audrey Tester Addon it will auto generate your addons for you, so there will be no need for any programming knowledge to create addons.
All that's needed is a JSON file (obviously built in the correct structure) which will scrape websites for content and play them back using URLResolver.
It's possible to create folders, link to other JSON files and have multi-level addons (to allow for things like series and episodes etc).
I'm not that great at explaining things, so hopefully the guide below and videos (linked at the bottom of this post) make sense, if you need anything explained further let me know and I'll add to this.
The addon script can be directly downloaded from here or by installing the PTOM Repo.
To install the PTOM Repo follow the instructions below
1. Within Kodi go to System > File Manager
2. Select Add Source
3. Enter http://fusion.tvaddons.co as the media location
4. Go to the kodi-repos folder
5. Enter the xxx-adult folder
6. Enter PTOM Repo as the name for the media source
7. Select OK
8. Go to Home
9. Go to System > Settings > Add-ons and select Install from zip file
10. Select PTOM Repo and then select the repository.ptom
< for Audrey Tester also do >
11. Once the message has popped up saying the addon has been installed, go to Install from repository
12. Select PTOM Repo > Video add-ons > Audrey Tester > Install
13. Once installed you will now be able to access Audrey Tester from Video > Add-ons > Audrey Tester
Once you have the PTOM Repo installed you can then start creating your own addons. Whilst it is possible to manually create your own addons, I'd recommend installing the Audrey Tester as this will allow you to test your addons prior to releasing them and once finished it will allow you to export to a zip'd file ready to be installed.
To add content to Audrey or to create a whole new Addon, the first thing you'll need to is to create a JSON file. If you've never created one of these before they're fairly straight forward and easy to understand, basically it's just a way to store data in a readable way, if you'd like a slightly more detailed explanation have a look here. To load a new JSON file into the Audrey Tester you need to open Audrey Tester's settings, here you can link to a local JSON file or to one stored online by entering a URL. Next time you open Audrey Tester the content will reflect the JSON file that you've loaded. For the most part the JSON files structure remains fairly consistent and can be copy pasted in to work with new site and just changing the values. If you're working with a site like YouTube, then you may find that all you need to do is amend the channel/user id from an Audrey file already pulling from YouTube. To see what's possible using Audrey I've created some basic Addons that can be found in the PTOM Repo, I've listed these below with links to the JSON files so you can have a look and see how they work;
Funny or Die - https://www.jasonbase.com/things/B1W3.json
JPop - https://www.jasonbase.com/things/A2DL.json
Tromaverse - https://www.jasonbase.com/things/PdZm.json
Zero Punctuation - https://www.jasonbase.com/things/MjA5.json
The JPop addon pulls a number of playlists from Youtube to form a collection of Music Video from Japanese artists.
Tromaverse and Zero Punctuation also pull from YouTube, but these are a bit more advanced and show how you can YouTube's API with Audrey.
Lastly the Funny or Die Addon pulls directly from the Funny or Die site, this Addon is a bit more advanced as it allows the user to search for content and specifically chooses a stream to play back to the user.
If you've opened up any of the links above, you'll have seen the basic structure of the JSON file, I'll take a second now to explain each part, how it works and how to work out what to put in the values (values have been left empty below).
Code:
{
"folders": [
{
"name" : "",
"poster" : "",
"fanart" : "",
"site_json": ""
},
],
"sites": [
{
"name": "",
"folder": "",
"poster": "",
"fanart": "",
"search_url": "",
"items": {
"Latest": [
{
"site_url": "",
"global": "",
"pattern": "",
"name": "",
"url": "",
"plot": "",
"poster": "",
"fanart": "",
"play_media": ""
"next_pattern": "",
"next_url": ""
}
]
},
"tags" : [
{
"name" : "Year",
"url" : "",
"item" : {
"global" : "",
"pattern" : "",
"name" : "",
"url" : "",
"next_pattern" : "",
"next_url": ""
}
}
]
}
]
}
Code:
<ul class="film-content-holder">
<li style="list-style-type: none;">
<ul class="film-content-holder">
<li class="video-holder"><img src="images/path-to-film-cover.jpg" />
<img src="images/path-to-film-fanart.jpg" />
<span class="title">Film Title: </span> <a href="video/link-to-film.mp4">Play me</a>A description of the film
</li>
</ul>
</li>
</ul>
...
<a class="next-page" href="next-page.html">Next page</a>
"name" (required) - this is the name that you want to give the site, it will be shown in Kodi when opening Audrey.
"poster" (required) - this is the poster image you want to show for this item.
"fanart" (required) - this is the fanart image you want to show for this item.
"search_url" (optional) - if a search url is specified you will be given a search option within Kodi. The search url takes the full url with the users search represented with a {%}. To find the search URL for a site, simply find the search feature to the site you are scraping and enter a search in. Copy and paste the URL and replace your search term with {%} For example, if I have a website whose search URL is;
http://my-site.com/?s=my-search-term the url that we would enter into the search_url would be; http://my-site.com/?s={%}
"items" (required) - Each site must contain at least one item, items will show in the Kodi menu as a selectable option, in the above blank example I've used "Latest" so in here we would add a search pattern to pull the latest content. Each item can have as many sub objects as needed, this can be used for example to first pull a list of shows, then a list of series for that show and then finally a list of episodes.
If you are using the search_url then the results will always use the very first item. If you need a specific Search item, make sure that it is the very first item specified and that it is called "Search", this will be ignored and not show within the addon as an item and only used if a search is performed.
"site_url" (required) - this is the initial URL that has the content you want to search for. Using funnyordie.com as an example again, you could use "http://www.funnyordie.com/browse/videos/all/originals/most_recent/all_time" as the site_url to show the Latest videos.
"global" (optional) - this search pattern is used to target the container of the information we need. This is used as sometimes HTML get's repeated throughout a web page and to save pull up information that you may not necessarily want, this allows us to target a specific area to search. Using the example given above, our global would be; "<ul class="film-content-holder">{%}</ul>"
"pattern" (required) - this search pattern is used to pull out the content of each video entry. In the example above we would use the following pattern; "<li class="video-holder">{*}src="{&}"{*}src="{%}"{*}<span class="title">{%}:{*}href="{%}"{*}<p>{%}</p>{*}</li>" This would search either the site or the content retrieved from the global pattern and retrieve the following information, it would continue to retrieve as many times as the patterns match. {%1} = "images/path-to-film-cover.jpg" {%2} = "images/path-to-film-fanart.jpg" {%3} = "Film Title" {%4} = "video/link-to-film.mp4" {%5} = "A description of the film" Using these variables we can then populate the fields below "name" - this is the name which is displayed in Kodi. In the case of the above the value for this would be "{%3}"
"url" - this is the URL to either then next page of information/video content/video URL. In the case about this would he "http://my-site.com/{%4}". The start of the URL is needed as in this case the full URL isn't given/
"plot" - this is the plot of the current videon content. In the above case this would be, "{%5}"
"poster" (required) - this is the poster image you want to show for this item. In the above case this would be "http://my-site.com/{%1}"
"fanart" (required) - this is the fanart image you want to show for this item. In the above case this would be "http://my-site.com/{%2}"
"play_media" (optional) - this can be included in the last item in an items object, it's used to represent what media should be played in Kodi. It can be set to "auto" (or not included) to play the first video feed Audrey finds, it can be set to "multiple" to display a list of all media sources found and allow the user to choose which source should be played. And finally it can be set to numeric value of the video you want to play, e.g "1" would play the first video found, "2" would play the second video found, etc etc.
"next_pattern" (optional) - this is used to tell audrey if there is another page of content to search. If it finds the search pattern it will display a Next option in the Kodi menu. In the above example the content would be set to; "<a class="next-page" href="{%}">Next page</a>"
"next_url" - using the next_pattern we form the URL that Kodi will load in next. For the above example it would be "http://mysite.com/{%1}"
Some final points To make patterns that little bit easier, you can use the Feed43 site to help you create your patterns and see the results that are produced. You can then copy and paste these out into the JSON file. And one thing to remember is that in your patterns you muse escape any double quotes. Basically change any " to " If you only have one level of items and no search or tags, Audrey will take you straight to the content, there's no point in showing menus with only 1 item in it, right? Hopefully this makes some sense, if it doesn't take a look through some of the above linked JSON files and hopefully things will become clearer.
A simple guide on how the search patterns work can be found at http://feed43.com/understanding-patterns.html and can be found in the video tutorials linked below.
Once you've written your JSON file and everything is working correctly you can then use the Create Addon option within Audrey Testers settings to create an installable Kodi zip.
I've put up a couple of video tutorials showing how to use Audrey, apologises for the sound quality of these, I need to actually but a mic.
<< video link to be added >>
If anyone has any problems, help or feature ideas leave a message and I'll see what I can do.
Last edited: