SlyGuy Addons: Smart URL Actions

This is a Supporter Only feature

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 supported.

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:

doesn't match:

Available Actions

DNS Server Resolver

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.

r: *
r: *
r: *
r: *

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

DNS over HTTPS is also supported for JSON friendly servers like Cloudflare and Google.

If you want to use a Smart DNS Server for an 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. Or as per above, you can apply it to all addons by putting the urls.txt in script.module.slyguy addon data.
No more changing DNS settings on your device or router.

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 p: so the script can identify it.

Modes Supported: http, https, socks4, socks4a, socks5, socks5h
(4a and 5h both use remote dns resolving)


Network Interface IP

This routes the matched URL via the provided network interface.
The network interface IP must start with i: so the script can identify it. 

i: *

Any urls matching will route through the network interface with IP
Any other urls will route through the network interface with IP


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.



Check out the Supporter Perks