All SlyGuy Addons support: Smart URL Actions
This allows you to specify URL patterns that then have various actions applied to them.
These patterns can be applied to all addons or only applied to specific addons.
All SlyGuy Addon urls used internally (talking to the various APIs etc) or used for media playback are checked against these patterns.
I personally use this with my Smart DNS provider (dns4me.net) to automatically apply their smart dns functionality without requiring changes to dns settings on any of my devices. As I can apply it on per add-on basis it allows for different services that use the same domains to allow both to work. This is not possible when using router / device dns. eg. 9Now and TVNZ (both use same brightcove host). I can just add a urls.txt for 9Now only so only it routes via the smart dns IP address.
File to use
To apply to all add-ons, the file used is kodi/userdata/addon_data/script.module.slyguy/urls.txtTo apply to specific add-on, the file used is kodi/userdata/addon_data/{addon id}/urls.txt
(if these folders don't exist - run the addon once and it'll create them)
The file is read from top to bottom and stops once a single url match is found.
If both a common and add-on urls.txt are found, the addons urls patterns take priority.
If none of those patterns match, it will then check the common patterns.
The format is
action pattern
action pattern
action pattern
(same as hosts file)
Available URL Patterns
Examples
brightcove.commatches: http://brightcove.com
matches: https://edge.api.brighcove.com/api/121?test=123
brightcove.com/api/
matches: https://edge.api.brighcove.com/api/121?test=123
Wildcard
There is also a wildcard character which is *This matches 0 or more of any character.
This can be used like below:
http://*brightcove.com/api/
matches: http://edge.api.brighcove.com/api/121?test=123
doesnt match: https://edge.api.brightcove.com/
Available Actions
DNS Rewrite
This overrides the IP address resolution for the matching URL with a provided value
eg.
43.209.63.213 edge.api.brightcove.com
If the url matches, the domain name IP lookup for the urls hostname will be overridden with the provided IP address. The format is compatible with hosts files format. eg - the one you can download from dns4me.
eg.
43.209.63.213 edge.api.brightcove.com
If the url matches, the domain name IP lookup for the urls hostname will be overridden with the provided IP address. The format is compatible with hosts files format. eg - the one you can download from dns4me.
Proxy
This routes the matched URL via the provided proxy.
The proxy url must start with > so the script can identify it as a proxy and not a url replace
eg.
>socks5://user:pass@host:port edge.api.brightcove.com
>http://host:port edge.api.brightcove.com
Replace
The proxy url must start with > so the script can identify it as a proxy and not a url replace
eg.
>socks5://user:pass@host:port edge.api.brightcove.com
>http://host:port edge.api.brightcove.com
This is handy to force certain CDNs for various services.
eg.
vodhds-au.akamaihd.net vodhds-*.akamaihd.net
With the above, if the url was https://vodhds-us.akamaihd.net/test.m3u8, it will be changed to https://voddhs-au.akamaihd.net/test.m3u8
This is great if your Smart DNS provider doesn't have a domain name that you found is being used.
URL
It is defined by just putting the url on it's own line.
eg.
https://dns4me.net/api/v2/get_hosts/hosts/214852da-2f80-48f9-be62-888642d6e5e3
When the urls.txt file is being loaded - it will download the above URL and add it's contents to it's list of patterns.
With dns4me, its as easy as copying in your Raw Host File API URL from their website into a urls.txt file inside your addons addon data directory. And that's it. It will be downloaded and cached for 5minutes. No more changing DNS settings on your device or router.