
Audrey
Latest version 0.6 (02.02.2018)
Found in PTOM Repo or Direct Download here
The idea behind this Addon was that I found myself using Feed43 to generate a quick RSS feed one day, and then thought to myself why the hell can't I just do that when building addons for sites I want to scrape. So by using the same search patterns as feed43 stroed in a JSON file we can search a site and output the results in Kodi.
I've been using for awhile a personal addon but thought I'd release because it could be useful for some people and to force me to update it if there's any suggestions.
It can be used in two ways, either use the settings to link to a json file (structure below) or create a new addon include this as a requirement and then pass the JSON file to the feedme function. Whilst the addon is meant to be totally customised by the end user I do include a sites.json file in the addon which it will prompt you to use if no JSON file has been selected, this will you a basic idea of how the addon will work.
Features
You are able to organise sites within folders
Able to setup multiple sites to be scraped
Each site can have a multi layered scraping (e.g scrape page 1, scrape page 2, play video etc), you can also set up as many as these as needed (e.g Latest Movies, Latest Shows)
Tags, Categories (if the site offers them) can also be scraped, again you can have as many as these per site as needed
The ability to search by keyword (if the site offers it) a site and scrape the results
Detect and play numerous sources (uses urlresolver)
Download any of the content videos
Using Audrey to create a separate Addon
As mentioned if you want to create a quick addon then you can simply include Audrey as a requirement and pass the json file to it. The code is pretty straight forward and would look something like the below (this presumes that the sites.json file is stored within the Addon folder.
import audrey
import os, xbmcaddon
home = xbmc.translatePath(addon.getAddonInfo('path'))
audrey.feedme(os.path.join(home, "sites.json"), "file")
# alternatively you could link to a URL
# audrey.feedme("http://mywebsite.com/path/to/sites.json", "url")
Structure of the JSON file
I'll include a some simple JSON below that should hopefully show how most things works, if anything unclear let me know and I'll explain further. I'd highly recommend using the http://feed43.com/ feed generator to test and then copy into the JSON file.
Folders aren't nessecary, but I've been using them to easily group relevant sites, any site with the folder tag that matches a Folder will display in it, any site without a folder element will simply just display on the first screen.
Although not in the below example (but in the example JSON file in the addon, don't forget to have a look through this for more examples) each item can have a "global" much like on Feed43
The example below will load the video folders found at http://ptom.co.uk/video/ it will also include an Artists feature and a Search feature. Copy and Paste it into a file, save it and browse to it within the settings of the Audrey Addon to see how it looks and works.
{
"folders" : [
{
"name" : "Music Videos",
"poster" : "https://raw.githubusercontent.com/ptom98/PTOM/master/repository.ptom/icon.png",
"fanart" : "http://www.mcmbuzz.com/wp-content/uploads/2014/08/img20100819150048869.jpg"
}
],
"sites" : [
{
"name" : "PTOM J-Pop Example",
"folder" : "Music Videos",
"poster" : "https://raw.githubusercontent.com/ptom98/PTOM/master/repository.ptom/icon.png",
"fanart" : "http://www.mcmbuzz.com/wp-content/uploads/2014/08/img20100819150048869.jpg",
"search_url" : "http://ptom.co.uk/video/?s={%}",
"items" : {
"Latest" : [
{
"site_url" : "http://ptom.co.uk/video/",
"pattern" : "<article{*}href=\"{%}\" title=\"{%}\"{*}src=\"{%}\"{*}</article>",
"name" : "{%2}",
"url" : "{%1}",
"poster" : "{%3}",
"fanart" : "{%3}",
"next_pattern" : "<a class=\"next page-numbers\" href=\"{%}\">Older posts",
"next_url" : "{%1}"
}
]
},
"tags" : [
{
"name" : "Artists",
"url" : "http://ptom.co.uk/video/",
"item" : {
"pattern" : "<li class=\"cat-item{*}href=\"{%}\"{*}>{%}</a>{*}</li>",
"name" : "{%2}",
"url" : "{%1}",
"poster" : "",
"fanart" : ""
}
}
]
}
]
}