From db73447b1af348cc16a5ef7ee96fbd671350bdbd Mon Sep 17 00:00:00 2001 From: Ruud Date: Sun, 5 Feb 2012 15:05:33 +0100 Subject: [PATCH] Better belongsto check when different subdomain --- couchpotato/core/providers/userscript/base.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/providers/userscript/base.py b/couchpotato/core/providers/userscript/base.py index 1bf576ff..d4b3b9f3 100644 --- a/couchpotato/core/providers/userscript/base.py +++ b/couchpotato/core/providers/userscript/base.py @@ -32,8 +32,9 @@ class UserscriptBase(Plugin): def belongsTo(self, url): host = urlparse(url).hostname - if host.startswith('www.'): - host = host[4:] + host_split = host.split('.') + if len(host_split) > 2: + host = host[len(host_split[0]):] for include in self.includes: if host in include: