Audrey - Create Kodi addons with no Python knowledge [RELEASE] Audrey - Create Kodi addons with no Python knowledge | Kodi Forums
Results 1 to 8 of 8
  1. #1
    Addon Developer
    Join Date
    Jul 2015
    Posts
    33

    Audrey - Create Kodi addons with no Python knowledge


    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": ""
                        }
                    }
                ]
            }
        ]
    }
    Folders Folders are used for two purposes, the first is to group sites together. If you creating a JSON with a number of sites you may wish to organize them appropriately. The second use is simply to link to another JSON file, this way when you open Audrey/your Addon you can link in numerous JSON filesand browse each one by opening the relevant folder. If you don't wish to use folders, then you do not have to include this in your JSON file and can just include the sites. "name" (required) - this is the name that you want to give the folder, 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. "site_json" (optional) - this is the URL to another JSON file you want to link to. Sites Here we put the sites that you want to scrape. You can put as many as you want in here. Each site will have some basic details; name, poster, fanart etc, but the amount of items and tags it will have will depend very much on the site you're scraping. Content is scraped by using search patterns, similar to a regular expression but much more simple. A search patterns with Audrey uses just two search functions {%} and {*}. We use {%} to represent information we want to store in a variable and {*} to represent information that we're not interested in. For each {%} used within the search pattern, we can then use it's value you be a corresponding {%1}, {%2} etc. Below you will see a simple piece of HTML which I will use when giving examples on extracting data below.

    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>
    A site can also contain Tags, these are similar to items, except they can only ever one level. Usually this is used to pull information to help search for content, for example in the above blank JSON I use the title Year. When a tag is selected within Kodi it will always use the first item to then search for content.

    "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 by ptom; 04-04-2018 at 10:46 AM.

  2. #2
    Junior Member
    Join Date
    Dec 2015
    Posts
    13
    mmmmmmm... i have a question.
    I have supposedly the old version..... i have the plugins.video.audrey 1.0.6. There's no more avaible on repo.

    Right now i have uninstalled and i have installed both.. the demo and the tester........... i need also the install of script ?

  3. #3
    Addon Developer
    Join Date
    Jul 2015
    Posts
    33
    The script will install in the background when you install any addon using Audrey, so if you have either the demo or the tester installed the script will have been installed in the background as well.

  4. #4
    Junior Member
    Join Date
    Apr 2018
    Posts
    2

    Trouble with fanart

    I'm trying to create an app using Audrey, but when I click on the fanart section to find the fanart.jpg it doesn't show up. It seems to be only detecting my png files.

  5. #5
    Junior Member
    Join Date
    Apr 2018
    Posts
    2
    The value for fanart got changed from jpg to png in the settings.xml of v1.0.1. I changed it back to jpg in mine and works great. However, I have a new issue. Installation of either of the apps I made failed. The errors in my log are below.

    21:13:55.258 T:123145557745664 WARNING: [xbmcswift2] No converter provided, unicode should be used, but returning str value
    21:13:55.351 T:123145557745664 WARNING: Previous line repeats 1 times.
    21:13:55.351 T:123145557745664 NOTICE: [xbmcswift2] Request for "/video/podcasts/my/" matches rule for function "show_my_podcasts"
    21:13:55.366 T:123145557745664 ERROR: NEWADDON Invalid Date Format ""
    21:14:00.390 T:123145557745664 ERROR: Previous line repeats 72 times.
    21:14:00.390 T:123145557745664 ERROR: GetDirectory - Error getting noop
    21:14:36.183 T:140735503344512 ERROR: ExecuteAsync - Not executing non-existing script script.favourites
    21:14:41.788 T:123145558818816 WARNING: CSkinInfo: failed to load skin settings
    21:14:41.805 T:140735503344512 WARNING: Skin has invalid include: Animation_DialogPopupOpenClose
    21:14:45.853 T:123145565257728 WARNING: DARWINOSX: underflow (0 vs 4096 bytes)
    21:20:46.797 T:140735503344512 ERROR: ExecuteAsync - Not executing non-existing script script.favourites
    Last edited by colec74; 04-16-2018 at 08:27 PM.

  6. #6
    Addon Developer
    Join Date
    Jul 2015
    Posts
    33
    Uploaded the fix that switches png to jpg, thanks for pointing that out, must of overwritten it by mistake and not noticed.
    I'm presuming everything works when testing in Audrey Tester, odd that it doesn't work outside... can you post the full log or if possible the generated zip file and I'll take a look.

  7. #7
    Junior Member
    Join Date
    Mar 2018
    Posts
    3
    {
    "name": "www.fullhdfilmizlesene.org",
    "poster": "https://static8.depositphotos.com/1378583/987/v/950/depositphotos_9878369-stock-illustration-camera-and-film-logo.jpg",
    "fanart": "https://static8.depositphotos.com/1378583/987/v/950/depositphotos_9878369-stock-illustration-camera-and-film-logo.jpg",
    "Aksiyon": [
    {
    "site_url": "https://www.fullhdfilmizlesene.org/filmizle/aksiyon-filmleri",
    "pattern": "<img src="{%}"{*}<a href="{%}" title="{%}"",
    "name": "{%3}",
    "url": "{%2}",
    "poster": "{%1}",
    "fanart": "{%1}"
    }
    ],
    name is ok,
    poster is ok,
    fanart is ok,
    but I don't watch any movie
    I think url is problem but how can I fix?

  8. #8
    Addon Developer
    Join Date
    Jul 2015
    Posts
    33
    @pink09 issue the video link is stored in a base64 decoded string, so Audrey cannot detect it. I'll add this into the todo list for a future release

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •