SlyGuy Addons: Smart URL Actions

All SlyGuy Addons support: Smart URL Actions

This allows you to specify URL patterns that then have various actions applied to them.

 They can be applied to all add-ons and or to a single addon.

All SlyGuy addon urls used internally (talking to the various APIs etc) or used for media playback are eligible.

I personally use this with my Smart DNS provider ( 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 both 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 and TVNZ traffic is untouched.

File to use

To apply to all add-ons, the file used is kodi/userdata/addon_data/script.module.slyguy/urls.txt
To 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)

urls.txt is simple text file with a pattern & action - one per line.
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

The pattern is very basic and its a search match so if the pattern is found anywhere in the requested url - its chosen.



There is also a wildcard character which is *
This matches 0 or more of any character.
This can be used like below:

doesnt match:

Available Actions

DNS Rewrite

This overrides the IP address resolution for the matching URL with a provided value


If the url matches, the domain name IP lookup will be overridden with the provided IP address. The format is compatible with hosts files format.


This routes the matched URL via the provided proxy.
The proxy url must start with > so the script can identify it as a proxy url. 

>socks5://user:[email protected]:port


This routes the matched URL via a desired DNS server (resolver)
The dns server IP must start with r: so the script can identify it as a dns server

r: *

Any urls matching will do a DNS lookup to
Any other urls will do DNS lookup to

Or, if you want to use a Smart DNS Server for a single add-on, simply create a urls.txt in that add-ons folder with
r:[smart dns ip] * and now all urls in that add-on only will route via the smart dns server


This replaces the matched URL with a provided value (uses regex sub).
This is handy to force certain CDNs for various services.

eg. vodhds-*

With the above, if the url was, it will be changed to
This is great if your Smart DNS provider doesn't have a domain name that you found is being used. 


This will download the provided url and use it's patterns.
It is defined by just putting the url on it's own line.


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.